comparison OrthancStone/Sources/Platforms/Sdl/OrthancStoneSdlConfiguration.cmake @ 1899:917500c46fe0

moved the Platform folder from the Applications folder to the Stone library itself
author Alain Mazy <am@osimis.io>
date Sat, 29 Jan 2022 12:47:32 +0100
parents
children 563f6aa8e24c
comparison
equal deleted inserted replaced
1898:a5e54bd87b25 1899:917500c46fe0
1 /**
2 * Stone of Orthanc
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
7 *
8 * This program is free software: you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation, either version 3 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program. If not, see
20 * <http://www.gnu.org/licenses/>.
21 **/
22
23 #####################################################################
24 ## Sanity check of the configuration
25 #####################################################################
26
27 include(${ORTHANC_STONE_ROOT}/../Resources/CMake/OrthancStoneConfiguration.cmake)
28
29 if (ORTHANC_SANDBOXED)
30 message(FATAL_ERROR "Cannot enable SDL in sandboxed environments")
31 endif()
32
33 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten" OR
34 CMAKE_SYSTEM_NAME STREQUAL "PNaCl" OR
35 CMAKE_SYSTEM_NAME STREQUAL "NaCl32" OR
36 CMAKE_SYSTEM_NAME STREQUAL "NaCl64")
37 message(FATAL_ERROR "Trying to use a Web compiler for a native build")
38 endif()
39
40
41
42 #####################################################################
43 ## Configure SDL
44 #####################################################################
45
46 message("SDL is enabled")
47 include(${CMAKE_CURRENT_LIST_DIR}/SdlConfiguration.cmake)
48
49 add_definitions(
50 -DORTHANC_ENABLE_SDL=1
51 -DORTHANC_ENABLE_WASM=0
52 )
53
54 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND
55 NOT MSVC)
56 # This is necessary when compiling EXE for Windows using MinGW
57 link_libraries(mingw32)
58 endif()
59
60
61
62 #####################################################################
63 ## Additional source files for SDL
64 #####################################################################
65
66 list(APPEND ORTHANC_STONE_SOURCES
67 ${CMAKE_CURRENT_LIST_DIR}/SdlViewport.cpp
68 ${CMAKE_CURRENT_LIST_DIR}/SdlWindow.cpp
69 ${SDL_SOURCES}
70 )
71
72 if (ENABLE_OPENGL)
73 list(APPEND ORTHANC_STONE_SOURCES
74 ${CMAKE_CURRENT_LIST_DIR}/SdlOpenGLContext.cpp
75 )
76 endif()