comparison OrthancStone/Resources/CMake/OrthancStoneSdlConfiguration.cmake @ 1901:184b0aeae1af

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