Mercurial > hg > orthanc-stone
comparison Applications/Platforms/Sdl/OrthancStoneSdlConfiguration.cmake @ 1591:5887a4f8594b
moving platform-specific files out of the "OrthancStone" folder
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 23 Oct 2020 13:15:03 +0200 |
parents | |
children | 621e4e11783d |
comparison
equal
deleted
inserted
replaced
1590:7b963bccafef | 1591:5887a4f8594b |
---|---|
1 # Stone of Orthanc | |
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
3 # Department, University Hospital of Liege, Belgium | |
4 # Copyright (C) 2017-2020 Osimis S.A., Belgium | |
5 # | |
6 # This program is free software: you can redistribute it and/or | |
7 # modify it under the terms of the GNU Affero General Public License | |
8 # as published by the Free Software Foundation, either version 3 of | |
9 # the License, or (at your option) any later version. | |
10 # | |
11 # This program is distributed in the hope that it will be useful, but | |
12 # WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 # Affero General Public License for more details. | |
15 # | |
16 # You should have received a copy of the GNU Affero General Public License | |
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
18 | |
19 | |
20 | |
21 ##################################################################### | |
22 ## Sanity check of the configuration | |
23 ##################################################################### | |
24 | |
25 include(${ORTHANC_STONE_ROOT}/Resources/CMake/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}/SdlWindow.cpp | |
66 ${SDL_SOURCES} | |
67 ) | |
68 | |
69 if (ENABLE_OPENGL) | |
70 list(APPEND ORTHANC_STONE_SOURCES | |
71 ${CMAKE_CURRENT_LIST_DIR}/SdlOpenGLContext.cpp | |
72 ${CMAKE_CURRENT_LIST_DIR}/SdlViewport.cpp | |
73 ) | |
74 endif() |