comparison OrthancStone/Resources/CMake/OrthancStoneConfiguration.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 bd180f97c734
children 621e4e11783d
comparison
equal deleted inserted replaced
1590:7b963bccafef 1591:5887a4f8594b
54 if (ORTHANC_SANDBOXED) 54 if (ORTHANC_SANDBOXED)
55 if (ENABLE_CURL) 55 if (ENABLE_CURL)
56 message(FATAL_ERROR "Cannot enable curl in sandboxed environments") 56 message(FATAL_ERROR "Cannot enable curl in sandboxed environments")
57 endif() 57 endif()
58 58
59 if (ENABLE_SDL)
60 message(FATAL_ERROR "Cannot enable SDL in sandboxed environments")
61 endif()
62
63 if (ENABLE_SSL) 59 if (ENABLE_SSL)
64 message(FATAL_ERROR "Cannot enable SSL in sandboxed environments") 60 message(FATAL_ERROR "Cannot enable SSL in sandboxed environments")
65 endif() 61 endif()
66 endif() 62 endif()
67 63
68 if (ENABLE_OPENGL)
69 if (NOT ENABLE_SDL AND NOT ENABLE_WASM)
70 message(FATAL_ERROR "Cannot enable OpenGL if WebAssembly and SDL are both disabled")
71 endif()
72 endif()
73
74 if (ENABLE_WASM)
75 if (NOT ORTHANC_SANDBOXED)
76 message(FATAL_ERROR "WebAssembly target must me configured as sandboxed")
77 endif()
78
79 if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
80 message(FATAL_ERROR "WebAssembly target requires the emscripten compiler")
81 endif()
82
83 set(ENABLE_THREADS OFF)
84 set(ENABLE_WEB_CLIENT OFF)
85 add_definitions(-DORTHANC_ENABLE_WASM=1)
86 else()
87 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten" OR
88 CMAKE_SYSTEM_NAME STREQUAL "PNaCl" OR
89 CMAKE_SYSTEM_NAME STREQUAL "NaCl32" OR
90 CMAKE_SYSTEM_NAME STREQUAL "NaCl64")
91 message(FATAL_ERROR "Trying to use a Web compiler for a native build")
92 endif()
93
94 set(ENABLE_THREADS ON)
95 add_definitions(-DORTHANC_ENABLE_WASM=0)
96 endif()
97
98 64
99 ##################################################################### 65 #####################################################################
100 ## Configure mandatory third-party components 66 ## Configure mandatory third-party components
101 ##################################################################### 67 #####################################################################
102 68
112 ##################################################################### 78 #####################################################################
113 79
114 if (ENABLE_WEB_CLIENT) 80 if (ENABLE_WEB_CLIENT)
115 list(APPEND ORTHANC_STONE_SOURCES 81 list(APPEND ORTHANC_STONE_SOURCES
116 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/OrthancDatasets/OrthancHttpConnection.cpp 82 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/OrthancDatasets/OrthancHttpConnection.cpp
117 )
118 endif()
119
120
121 if(ENABLE_SDL)
122 message("SDL is enabled")
123 include(${CMAKE_CURRENT_LIST_DIR}/SdlConfiguration.cmake)
124 add_definitions(
125 -DORTHANC_ENABLE_SDL=1
126 )
127 else()
128 message("SDL is disabled")
129 unset(USE_SYSTEM_SDL CACHE)
130 add_definitions(
131 -DORTHANC_ENABLE_SDL=0
132 ) 83 )
133 endif() 84 endif()
134 85
135 86
136 if (ENABLE_THREADS) 87 if (ENABLE_THREADS)
198 149
199 ##################################################################### 150 #####################################################################
200 ## System-specific patches 151 ## System-specific patches
201 ##################################################################### 152 #####################################################################
202 153
203 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND
204 NOT MSVC AND
205 ENABLE_SDL)
206 # This is necessary when compiling EXE for Windows using MinGW
207 link_libraries(mingw32)
208 endif()
209
210 if (ORTHANC_SANDBOXED) 154 if (ORTHANC_SANDBOXED)
211 # Remove functions not suitable for a sandboxed environment 155 # Remove functions not suitable for a sandboxed environment
212 list(REMOVE_ITEM ORTHANC_CORE_SOURCES 156 list(REMOVE_ITEM ORTHANC_CORE_SOURCES
213 ${ZLIB_SOURCES_DIR}/gzlib.c 157 ${ZLIB_SOURCES_DIR}/gzlib.c
214 ${ZLIB_SOURCES_DIR}/gzwrite.c 158 ${ZLIB_SOURCES_DIR}/gzwrite.c
220 164
221 ##################################################################### 165 #####################################################################
222 ## All the source files required to build Stone of Orthanc 166 ## All the source files required to build Stone of Orthanc
223 ##################################################################### 167 #####################################################################
224 168
225 if (ENABLE_SDL)
226 list(APPEND ORTHANC_STONE_SOURCES
227 ${ORTHANC_STONE_ROOT}/Sources/Viewport/SdlWindow.cpp
228 ${ORTHANC_STONE_ROOT}/Sources/Viewport/SdlWindow.h
229 )
230
231 if (ENABLE_OPENGL)
232 list(APPEND ORTHANC_STONE_SOURCES
233 ${ORTHANC_STONE_ROOT}/Sources/OpenGL/SdlOpenGLContext.cpp
234 ${ORTHANC_STONE_ROOT}/Sources/OpenGL/SdlOpenGLContext.h
235 ${ORTHANC_STONE_ROOT}/Sources/Viewport/SdlViewport.cpp
236 ${ORTHANC_STONE_ROOT}/Sources/Viewport/SdlViewport.h
237 )
238 endif()
239 endif()
240
241
242 if (ENABLE_DCMTK) 169 if (ENABLE_DCMTK)
243 list(APPEND ORTHANC_STONE_SOURCES 170 list(APPEND ORTHANC_STONE_SOURCES
244 ${ORTHANC_STONE_ROOT}/Sources/Oracle/ParseDicomSuccessMessage.cpp 171 ${ORTHANC_STONE_ROOT}/Sources/Oracle/ParseDicomSuccessMessage.cpp
245 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/OrthancDatasets/SimplifiedOrthancDataset.cpp 172 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/OrthancDatasets/SimplifiedOrthancDataset.cpp
246 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/ParsedDicomCache.cpp 173 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/ParsedDicomCache.cpp
253 list(APPEND ORTHANC_STONE_SOURCES 180 list(APPEND ORTHANC_STONE_SOURCES
254 ${ORTHANC_STONE_ROOT}/Sources/Loaders/GenericLoadersContext.cpp 181 ${ORTHANC_STONE_ROOT}/Sources/Loaders/GenericLoadersContext.cpp
255 ${ORTHANC_STONE_ROOT}/Sources/Loaders/GenericLoadersContext.h 182 ${ORTHANC_STONE_ROOT}/Sources/Loaders/GenericLoadersContext.h
256 ${ORTHANC_STONE_ROOT}/Sources/Oracle/GenericOracleRunner.cpp 183 ${ORTHANC_STONE_ROOT}/Sources/Oracle/GenericOracleRunner.cpp
257 ${ORTHANC_STONE_ROOT}/Sources/Oracle/ThreadedOracle.cpp 184 ${ORTHANC_STONE_ROOT}/Sources/Oracle/ThreadedOracle.cpp
258 )
259 endif()
260
261
262 if (ENABLE_WASM)
263 list(APPEND ORTHANC_STONE_SOURCES
264 ${ORTHANC_STONE_ROOT}/Sources/Loaders/WebAssemblyLoadersContext.cpp
265 ${ORTHANC_STONE_ROOT}/Sources/Oracle/WebAssemblyOracle.cpp
266 ${ORTHANC_STONE_ROOT}/Sources/Viewport/WebAssemblyCairoViewport.cpp
267 ${ORTHANC_STONE_ROOT}/Sources/Viewport/WebAssemblyViewport.cpp
268 ${ORTHANC_STONE_ROOT}/Sources/Viewport/WebAssemblyViewport.h
269 ) 185 )
270 endif() 186 endif()
271 187
272 188
273 if (ENABLE_PUGIXML) 189 if (ENABLE_PUGIXML)
308 ${ORTHANC_STONE_ROOT}/Sources/Loaders/DicomStructureSetLoader.h 224 ${ORTHANC_STONE_ROOT}/Sources/Loaders/DicomStructureSetLoader.h
309 ${ORTHANC_STONE_ROOT}/Sources/Loaders/DicomVolumeLoader.cpp 225 ${ORTHANC_STONE_ROOT}/Sources/Loaders/DicomVolumeLoader.cpp
310 ${ORTHANC_STONE_ROOT}/Sources/Loaders/IFetchingItemsSorter.h 226 ${ORTHANC_STONE_ROOT}/Sources/Loaders/IFetchingItemsSorter.h
311 ${ORTHANC_STONE_ROOT}/Sources/Loaders/IFetchingStrategy.h 227 ${ORTHANC_STONE_ROOT}/Sources/Loaders/IFetchingStrategy.h
312 ${ORTHANC_STONE_ROOT}/Sources/Loaders/LoadedDicomResources.cpp 228 ${ORTHANC_STONE_ROOT}/Sources/Loaders/LoadedDicomResources.cpp
313 ${ORTHANC_STONE_ROOT}/Sources/Loaders/LoaderCache.cpp
314 ${ORTHANC_STONE_ROOT}/Sources/Loaders/LoaderCache.h
315 ${ORTHANC_STONE_ROOT}/Sources/Loaders/LoaderStateMachine.cpp 229 ${ORTHANC_STONE_ROOT}/Sources/Loaders/LoaderStateMachine.cpp
316 ${ORTHANC_STONE_ROOT}/Sources/Loaders/LoaderStateMachine.h 230 ${ORTHANC_STONE_ROOT}/Sources/Loaders/LoaderStateMachine.h
317 ${ORTHANC_STONE_ROOT}/Sources/Loaders/OrthancMultiframeVolumeLoader.cpp 231 ${ORTHANC_STONE_ROOT}/Sources/Loaders/OrthancMultiframeVolumeLoader.cpp
318 ${ORTHANC_STONE_ROOT}/Sources/Loaders/OrthancMultiframeVolumeLoader.h 232 ${ORTHANC_STONE_ROOT}/Sources/Loaders/OrthancMultiframeVolumeLoader.h
319 ${ORTHANC_STONE_ROOT}/Sources/Loaders/OracleScheduler.cpp 233 ${ORTHANC_STONE_ROOT}/Sources/Loaders/OracleScheduler.cpp
531 ${CAIRO_SOURCES} 445 ${CAIRO_SOURCES}
532 ${FREETYPE_SOURCES} 446 ${FREETYPE_SOURCES}
533 ${PIXMAN_SOURCES} 447 ${PIXMAN_SOURCES}
534 448
535 # Optional components 449 # Optional components
536 ${SDL_SOURCES}
537 ${QT_SOURCES}
538 ${GLEW_SOURCES} 450 ${GLEW_SOURCES}
539 ) 451 )
540 452
541 453
542 if (ENABLE_OPENGL) 454 if (ENABLE_OPENGL)
576 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLTextRenderer.cpp 488 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLTextRenderer.cpp
577 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLTextRenderer.h 489 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLTextRenderer.h
578 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLTextureProgram.cpp 490 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLTextureProgram.cpp
579 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLTextureProgram.h 491 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLTextureProgram.h
580 ) 492 )
581 493 endif()
582 if (ENABLE_WASM) 494
583 list(APPEND ORTHANC_STONE_SOURCES
584 ${ORTHANC_STONE_ROOT}/Sources/OpenGL/WebAssemblyOpenGLContext.cpp
585 ${ORTHANC_STONE_ROOT}/Sources/OpenGL/WebAssemblyOpenGLContext.h
586 ${ORTHANC_STONE_ROOT}/Sources/Viewport/WebGLViewport.cpp
587 ${ORTHANC_STONE_ROOT}/Sources/Viewport/WebGLViewportsRegistry.cpp
588 )
589 endif()
590 endif()
591 495
592 ## 496 ##
593 ## TEST - Automatically add all ".h" headers to the list of sources 497 ## TEST - Automatically add all ".h" headers to the list of sources
594 ## 498 ##
595 499