comparison OrthancStone/Resources/CMake/OrthancStoneConfiguration.cmake @ 1512:244ad1e4e76a

reorganization of folders
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 07 Jul 2020 16:21:02 +0200
parents Resources/CMake/OrthancStoneConfiguration.cmake@b7210c688ca7
children 3eca4f9c2827
comparison
equal deleted inserted replaced
1511:9dfeee74c1e6 1512:244ad1e4e76a
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 ## Configure the Orthanc Framework
23 #####################################################################
24
25 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system")
26 include(${CMAKE_CURRENT_LIST_DIR}/../Orthanc/CMake/DownloadOrthancFramework.cmake)
27 link_libraries(${ORTHANC_FRAMEWORK_LIBRARIES})
28
29 # Switch to the C++11 standard if the version of JsonCpp is 1.y.z
30 if (EXISTS ${JSONCPP_INCLUDE_DIR}/json/version.h)
31 file(STRINGS
32 "${JSONCPP_INCLUDE_DIR}/json/version.h"
33 JSONCPP_VERSION_MAJOR1 REGEX
34 ".*define JSONCPP_VERSION_MAJOR.*")
35
36 if (NOT JSONCPP_VERSION_MAJOR1)
37 message(FATAL_ERROR "Unable to extract the major version of JsonCpp")
38 endif()
39
40 string(REGEX REPLACE
41 ".*JSONCPP_VERSION_MAJOR.*([0-9]+)$" "\\1"
42 JSONCPP_VERSION_MAJOR ${JSONCPP_VERSION_MAJOR1})
43 message("JsonCpp major version: ${JSONCPP_VERSION_MAJOR}")
44
45 if (JSONCPP_VERSION_MAJOR GREATER 0)
46 message("Switching to C++11 standard")
47 if (CMAKE_COMPILER_IS_GNUCXX)
48 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
49 elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
50 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
51 endif()
52 endif()
53 endif()
54
55 else()
56 if (ENABLE_DCMTK)
57 set(ENABLE_LOCALE ON)
58 else()
59 if (NOT DEFINED ENABLE_LOCALE)
60 set(ENABLE_LOCALE OFF) # Disable support for locales (notably in Boost)
61 endif()
62 endif()
63
64 include(${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake)
65 include_directories(
66 ${ORTHANC_FRAMEWORK_ROOT}/Sources/
67 )
68 endif()
69
70
71 #####################################################################
72 ## Sanity check of the configuration
73 #####################################################################
74
75 if (ORTHANC_SANDBOXED)
76 if (ENABLE_CURL)
77 message(FATAL_ERROR "Cannot enable curl in sandboxed environments")
78 endif()
79
80 if (ENABLE_SDL)
81 message(FATAL_ERROR "Cannot enable SDL in sandboxed environments")
82 endif()
83
84 if (ENABLE_SSL)
85 message(FATAL_ERROR "Cannot enable SSL in sandboxed environments")
86 endif()
87 endif()
88
89 if (ENABLE_OPENGL)
90 if (NOT ENABLE_SDL AND NOT ENABLE_WASM)
91 message(FATAL_ERROR "Cannot enable OpenGL if WebAssembly and SDL are both disabled")
92 endif()
93 endif()
94
95 if (ENABLE_WASM)
96 if (NOT ORTHANC_SANDBOXED)
97 message(FATAL_ERROR "WebAssembly target must me configured as sandboxed")
98 endif()
99
100 if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
101 message(FATAL_ERROR "WebAssembly target requires the emscripten compiler")
102 endif()
103
104 set(ENABLE_THREADS OFF)
105 add_definitions(-DORTHANC_ENABLE_WASM=1)
106 else()
107 if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten" OR
108 CMAKE_SYSTEM_NAME STREQUAL "PNaCl" OR
109 CMAKE_SYSTEM_NAME STREQUAL "NaCl32" OR
110 CMAKE_SYSTEM_NAME STREQUAL "NaCl64")
111 message(FATAL_ERROR "Trying to use a Web compiler for a native build")
112 endif()
113
114 set(ENABLE_THREADS ON)
115 add_definitions(-DORTHANC_ENABLE_WASM=0)
116 endif()
117
118
119 #####################################################################
120 ## Configure mandatory third-party components
121 #####################################################################
122
123 include(FindPkgConfig)
124 include(${CMAKE_CURRENT_LIST_DIR}/CairoConfiguration.cmake)
125 include(${CMAKE_CURRENT_LIST_DIR}/FreetypeConfiguration.cmake)
126 include(${CMAKE_CURRENT_LIST_DIR}/PixmanConfiguration.cmake)
127
128
129
130 #####################################################################
131 ## Configure optional third-party components
132 #####################################################################
133
134 if (NOT ORTHANC_SANDBOXED)
135 list(APPEND ORTHANC_STONE_SOURCES
136 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/OrthancDatasets/OrthancHttpConnection.cpp
137 )
138 endif()
139
140
141 if(ENABLE_SDL)
142 message("SDL is enabled")
143 include(${CMAKE_CURRENT_LIST_DIR}/SdlConfiguration.cmake)
144 add_definitions(
145 -DORTHANC_ENABLE_SDL=1
146 )
147 else()
148 message("SDL is disabled")
149 unset(USE_SYSTEM_SDL CACHE)
150 add_definitions(
151 -DORTHANC_ENABLE_SDL=0
152 )
153 endif()
154
155
156 if (ENABLE_THREADS)
157 add_definitions(-DORTHANC_ENABLE_THREADS=1)
158 else()
159 add_definitions(-DORTHANC_ENABLE_THREADS=0)
160 endif()
161
162
163 if (ENABLE_OPENGL AND CMAKE_SYSTEM_NAME STREQUAL "Windows")
164 include(${CMAKE_CURRENT_LIST_DIR}/GlewConfiguration.cmake)
165 add_definitions(
166 -DORTHANC_ENABLE_GLEW=1
167 )
168 else()
169 add_definitions(
170 -DORTHANC_ENABLE_GLEW=0
171 )
172 endif()
173
174
175 if (ENABLE_OPENGL)
176 if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
177 # If including "FindOpenGL.cmake" using Emscripten (targeting
178 # WebAssembly), the "OPENGL_LIBRARIES" value incorrectly includes
179 # the "nul" library, which leads to warning message in Emscripten:
180 # 'shared:WARNING: emcc: cannot find library "nul"'.
181 include(FindOpenGL)
182 if (NOT OPENGL_FOUND)
183 message(FATAL_ERROR "Cannot find OpenGL on your system")
184 endif()
185
186 link_libraries(${OPENGL_LIBRARIES})
187 endif()
188
189 add_definitions(
190 -DORTHANC_ENABLE_OPENGL=1
191 )
192 else()
193 add_definitions(-DORTHANC_ENABLE_OPENGL=0)
194 endif()
195
196
197
198 #####################################################################
199 ## Configuration of the C/C++ macros
200 #####################################################################
201
202 if (MSVC)
203 # Remove some warnings on Visual Studio 2015
204 add_definitions(-D_SCL_SECURE_NO_WARNINGS=1)
205 endif()
206
207 add_definitions(
208 -DHAS_ORTHANC_EXCEPTION=1
209 )
210
211 if (CMAKE_BUILD_TYPE STREQUAL "Debug")
212 add_definitions(-DCHECK_OBSERVERS_MESSAGES)
213 endif()
214
215
216
217 #####################################################################
218 ## System-specific patches
219 #####################################################################
220
221 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND
222 NOT MSVC AND
223 ENABLE_SDL)
224 # This is necessary when compiling EXE for Windows using MinGW
225 link_libraries(mingw32)
226 endif()
227
228 if (ORTHANC_SANDBOXED)
229 # Remove functions not suitable for a sandboxed environment
230 list(REMOVE_ITEM ORTHANC_CORE_SOURCES
231 ${ZLIB_SOURCES_DIR}/gzlib.c
232 ${ZLIB_SOURCES_DIR}/gzwrite.c
233 ${ZLIB_SOURCES_DIR}/gzread.c
234 )
235 endif()
236
237
238
239 #####################################################################
240 ## All the source files required to build Stone of Orthanc
241 #####################################################################
242
243 if (NOT ORTHANC_SANDBOXED)
244 set(PLATFORM_SOURCES
245 ${ORTHANC_STONE_ROOT}/Sources/Loaders/GenericLoadersContext.cpp
246 ${ORTHANC_STONE_ROOT}/Sources/Loaders/GenericLoadersContext.h
247 )
248
249 if (ENABLE_SDL)
250 list(APPEND ORTHANC_STONE_SOURCES
251 ${ORTHANC_STONE_ROOT}/Sources/Viewport/SdlWindow.cpp
252 ${ORTHANC_STONE_ROOT}/Sources/Viewport/SdlWindow.h
253 )
254 endif()
255
256 if (ENABLE_SDL)
257 if (ENABLE_OPENGL)
258 list(APPEND ORTHANC_STONE_SOURCES
259 ${ORTHANC_STONE_ROOT}/Sources/OpenGL/SdlOpenGLContext.cpp
260 ${ORTHANC_STONE_ROOT}/Sources/OpenGL/SdlOpenGLContext.h
261 ${ORTHANC_STONE_ROOT}/Sources/Viewport/SdlViewport.cpp
262 ${ORTHANC_STONE_ROOT}/Sources/Viewport/SdlViewport.h
263 )
264 endif()
265 endif()
266 endif()
267
268
269 if (ENABLE_DCMTK)
270 list(APPEND ORTHANC_STONE_SOURCES
271 ${ORTHANC_STONE_ROOT}/Sources/Oracle/ParseDicomSuccessMessage.cpp
272 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/ParsedDicomCache.cpp
273 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/ParsedDicomDataset.cpp
274 )
275 endif()
276
277 if (ENABLE_THREADS)
278 list(APPEND ORTHANC_STONE_SOURCES
279 ${ORTHANC_STONE_ROOT}/Sources/Oracle/ThreadedOracle.cpp
280 ${ORTHANC_STONE_ROOT}/Sources/Oracle/GenericOracleRunner.cpp
281 )
282 endif()
283
284
285 if (ENABLE_WASM)
286 list(APPEND ORTHANC_STONE_SOURCES
287 ${ORTHANC_STONE_ROOT}/Sources/Loaders/WebAssemblyLoadersContext.cpp
288 ${ORTHANC_STONE_ROOT}/Sources/Oracle/WebAssemblyOracle.cpp
289 ${ORTHANC_STONE_ROOT}/Sources/Viewport/WebAssemblyCairoViewport.cpp
290 ${ORTHANC_STONE_ROOT}/Sources/Viewport/WebAssemblyViewport.cpp
291 ${ORTHANC_STONE_ROOT}/Sources/Viewport/WebAssemblyViewport.h
292 )
293 endif()
294
295 if ((ENABLE_SDL OR ENABLE_WASM) AND ENABLE_GUIADAPTER)
296 list(APPEND APPLICATIONS_SOURCES
297 ${ORTHANC_STONE_ROOT}/Sources/Deprecated/GuiAdapter.cpp
298 ${ORTHANC_STONE_ROOT}/Sources/Deprecated/GuiAdapter.h
299 )
300 endif()
301
302
303 list(APPEND ORTHANC_STONE_SOURCES
304 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/OrthancDatasets/DicomDatasetReader.cpp
305 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/OrthancDatasets/DicomPath.cpp
306 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/OrthancDatasets/FullOrthancDataset.cpp
307 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/OrthancDatasets/IOrthancConnection.cpp
308
309 ${ORTHANC_STONE_ROOT}/Sources/Fonts/FontRenderer.cpp
310 ${ORTHANC_STONE_ROOT}/Sources/Fonts/Glyph.cpp
311 ${ORTHANC_STONE_ROOT}/Sources/Fonts/GlyphAlphabet.cpp
312 ${ORTHANC_STONE_ROOT}/Sources/Fonts/GlyphBitmapAlphabet.cpp
313 ${ORTHANC_STONE_ROOT}/Sources/Fonts/GlyphTextureAlphabet.cpp
314 ${ORTHANC_STONE_ROOT}/Sources/Fonts/TextBoundingBox.cpp
315
316 ${ORTHANC_STONE_ROOT}/Sources/Loaders/BasicFetchingItemsSorter.cpp
317 ${ORTHANC_STONE_ROOT}/Sources/Loaders/BasicFetchingItemsSorter.h
318 ${ORTHANC_STONE_ROOT}/Sources/Loaders/BasicFetchingStrategy.cpp
319 ${ORTHANC_STONE_ROOT}/Sources/Loaders/BasicFetchingStrategy.h
320 ${ORTHANC_STONE_ROOT}/Sources/Loaders/DicomResourcesLoader.cpp
321 ${ORTHANC_STONE_ROOT}/Sources/Loaders/DicomSource.cpp
322 ${ORTHANC_STONE_ROOT}/Sources/Loaders/DicomStructureSetLoader.cpp
323 ${ORTHANC_STONE_ROOT}/Sources/Loaders/DicomStructureSetLoader.h
324 ${ORTHANC_STONE_ROOT}/Sources/Loaders/DicomVolumeLoader.cpp
325 ${ORTHANC_STONE_ROOT}/Sources/Loaders/IFetchingItemsSorter.h
326 ${ORTHANC_STONE_ROOT}/Sources/Loaders/IFetchingStrategy.h
327 ${ORTHANC_STONE_ROOT}/Sources/Loaders/LoadedDicomResources.cpp
328 ${ORTHANC_STONE_ROOT}/Sources/Loaders/LoaderCache.cpp
329 ${ORTHANC_STONE_ROOT}/Sources/Loaders/LoaderCache.h
330 ${ORTHANC_STONE_ROOT}/Sources/Loaders/LoaderStateMachine.cpp
331 ${ORTHANC_STONE_ROOT}/Sources/Loaders/LoaderStateMachine.h
332 ${ORTHANC_STONE_ROOT}/Sources/Loaders/OrthancMultiframeVolumeLoader.cpp
333 ${ORTHANC_STONE_ROOT}/Sources/Loaders/OrthancMultiframeVolumeLoader.h
334 ${ORTHANC_STONE_ROOT}/Sources/Loaders/OracleScheduler.cpp
335 ${ORTHANC_STONE_ROOT}/Sources/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp
336 ${ORTHANC_STONE_ROOT}/Sources/Loaders/OrthancSeriesVolumeProgressiveLoader.h
337 ${ORTHANC_STONE_ROOT}/Sources/Loaders/SeriesFramesLoader.cpp
338 ${ORTHANC_STONE_ROOT}/Sources/Loaders/SeriesMetadataLoader.cpp
339 ${ORTHANC_STONE_ROOT}/Sources/Loaders/SeriesOrderedFrames.cpp
340 ${ORTHANC_STONE_ROOT}/Sources/Loaders/SeriesThumbnailsLoader.cpp
341
342 ${ORTHANC_STONE_ROOT}/Sources/Messages/ICallable.h
343 ${ORTHANC_STONE_ROOT}/Sources/Messages/IMessage.h
344 ${ORTHANC_STONE_ROOT}/Sources/Messages/IMessageEmitter.h
345 ${ORTHANC_STONE_ROOT}/Sources/Messages/IObservable.cpp
346 ${ORTHANC_STONE_ROOT}/Sources/Messages/IObservable.h
347 ${ORTHANC_STONE_ROOT}/Sources/Messages/IObserver.h
348 ${ORTHANC_STONE_ROOT}/Sources/Messages/ObserverBase.h
349
350 ${ORTHANC_STONE_ROOT}/Sources/Oracle/GetOrthancImageCommand.cpp
351 ${ORTHANC_STONE_ROOT}/Sources/Oracle/GetOrthancWebViewerJpegCommand.cpp
352 ${ORTHANC_STONE_ROOT}/Sources/Oracle/HttpCommand.cpp
353 ${ORTHANC_STONE_ROOT}/Sources/Oracle/OracleCommandBase.cpp
354 ${ORTHANC_STONE_ROOT}/Sources/Oracle/OrthancRestApiCommand.cpp
355 ${ORTHANC_STONE_ROOT}/Sources/Oracle/ParseDicomFromFileCommand.cpp
356 ${ORTHANC_STONE_ROOT}/Sources/Oracle/ParseDicomFromWadoCommand.cpp
357
358 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/CairoCompositor.cpp
359 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/CairoCompositor.h
360 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Color.h
361 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/ColorSceneLayer.h
362 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/ColorTextureSceneLayer.cpp
363 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/ColorTextureSceneLayer.h
364 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/FloatTextureSceneLayer.cpp
365 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/FloatTextureSceneLayer.h
366 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/GrayscaleStyleConfigurator.cpp
367 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/GrayscaleStyleConfigurator.h
368 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/ICompositor.h
369 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/ILayerStyleConfigurator.h
370 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/InfoPanelSceneLayer.cpp
371 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/InfoPanelSceneLayer.h
372 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/IPointerTracker.h
373 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/ISceneLayer.h
374 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/LookupTableStyleConfigurator.cpp
375 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/LookupTableStyleConfigurator.h
376 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/LookupTableTextureSceneLayer.cpp
377 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/LookupTableTextureSceneLayer.h
378 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/NullLayer.h
379 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/PanSceneTracker.cpp
380 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/PanSceneTracker.h
381 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/PointerEvent.cpp
382 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/PointerEvent.h
383 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/PolylineSceneLayer.cpp
384 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/PolylineSceneLayer.h
385 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/RotateSceneTracker.cpp
386 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/RotateSceneTracker.h
387 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Scene2D.cpp
388 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Scene2D.h
389 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/ScenePoint2D.h
390 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/TextSceneLayer.cpp
391 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/TextSceneLayer.h
392 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/TextureBaseSceneLayer.cpp
393 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/TextureBaseSceneLayer.h
394 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/ZoomSceneTracker.cpp
395 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/ZoomSceneTracker.h
396
397 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/CairoBaseRenderer.h
398 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/CairoColorTextureRenderer.cpp
399 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/CairoColorTextureRenderer.h
400 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/CairoFloatTextureRenderer.cpp
401 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/CairoFloatTextureRenderer.h
402 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/CairoInfoPanelRenderer.cpp
403 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/CairoInfoPanelRenderer.h
404 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/CairoLookupTableTextureRenderer.cpp
405 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/CairoLookupTableTextureRenderer.h
406 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/CairoPolylineRenderer.cpp
407 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/CairoPolylineRenderer.h
408 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/CairoTextRenderer.cpp
409 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/CairoTextRenderer.h
410 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/CompositorHelper.cpp
411 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/CompositorHelper.h
412 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/FixedPointAligner.cpp
413 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/FixedPointAligner.h
414 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/ICairoContextProvider.h
415
416 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/AngleMeasureTool.cpp
417 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/AngleMeasureTool.h
418 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/CreateAngleMeasureCommand.cpp
419 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/CreateAngleMeasureCommand.h
420 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/CreateAngleMeasureTracker.cpp
421 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/CreateAngleMeasureTracker.h
422 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/CreateCircleMeasureTracker.cpp
423 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/CreateCircleMeasureTracker.h
424 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/CreateLineMeasureCommand.cpp
425 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/CreateLineMeasureCommand.h
426 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/CreateLineMeasureTracker.cpp
427 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/CreateLineMeasureTracker.h
428 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/CreateMeasureTracker.cpp
429 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/CreateMeasureTracker.h
430 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/CreateSimpleTrackerAdapter.cpp
431 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/EditAngleMeasureCommand.cpp
432 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/EditAngleMeasureCommand.h
433 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/EditAngleMeasureTracker.cpp
434 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/EditAngleMeasureTracker.h
435 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/EditLineMeasureCommand.cpp
436 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/EditLineMeasureCommand.h
437 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/EditLineMeasureTracker.cpp
438 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/EditLineMeasureTracker.h
439 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/IFlexiblePointerTracker.h
440 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/LayerHolder.cpp
441 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/LayerHolder.h
442 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/LineMeasureTool.cpp
443 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/LineMeasureTool.h
444 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/MeasureCommands.cpp
445 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/MeasureCommands.h
446 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/MeasureTool.cpp
447 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/MeasureTool.h
448 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/MeasureToolsToolbox.cpp
449 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/MeasureToolsToolbox.h
450 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/MeasureTrackers.cpp
451 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/MeasureTrackers.h
452 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/OneGesturePointerTracker.cpp
453 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/OneGesturePointerTracker.h
454 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/PredeclaredTypes.h
455 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/UndoStack.cpp
456 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/UndoStack.h
457 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/ViewportController.cpp
458 ${ORTHANC_STONE_ROOT}/Sources/Scene2DViewport/ViewportController.h
459 ${ORTHANC_STONE_ROOT}/Sources/StoneEnumerations.cpp
460 ${ORTHANC_STONE_ROOT}/Sources/StoneException.h
461 ${ORTHANC_STONE_ROOT}/Sources/StoneInitialization.cpp
462
463 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/AffineTransform2D.cpp
464 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/AffineTransform2D.h
465 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/CoordinateSystem3D.cpp
466 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/CoordinateSystem3D.h
467 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/DicomInstanceParameters.cpp
468 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/DicomInstanceParameters.h
469 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/DicomStructure2.cpp
470 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/DicomStructure2.h
471 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/DicomStructurePolygon2.cpp
472 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/DicomStructurePolygon2.h
473 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/DicomStructureSet.cpp
474 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/DicomStructureSet.h
475 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/DicomStructureSet2.cpp
476 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/DicomStructureSet2.h
477 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/DicomStructureSetUtils.cpp
478 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/DicomStructureSetUtils.h
479 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/DisjointDataSet.h
480 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/DynamicBitmap.cpp
481 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/DynamicBitmap.h
482 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/Extent2D.cpp
483 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/Extent2D.h
484 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/FiniteProjectiveCamera.cpp
485 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/FiniteProjectiveCamera.h
486 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/GenericToolbox.cpp
487 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/GenericToolbox.h
488 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/GeometryToolbox.cpp
489 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/GeometryToolbox.h
490 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/ImageGeometry.cpp
491 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/ImageGeometry.h
492 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/ImageToolbox.cpp
493 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/ImageToolbox.h
494 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/LinearAlgebra.cpp
495 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/LinearAlgebra.h
496 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/PixelTestPatterns.h
497 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/ShearWarpProjectiveTransform.cpp
498 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/ShearWarpProjectiveTransform.h
499 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/SlicesSorter.cpp
500 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/SlicesSorter.h
501 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/SortedFrames.cpp
502 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/SortedFrames.h
503 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/SubpixelReader.h
504 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/SubvoxelReader.h
505 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/TextRenderer.cpp
506 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/TextRenderer.h
507 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/UndoRedoStack.cpp
508 ${ORTHANC_STONE_ROOT}/Sources/Toolbox/UndoRedoStack.h
509
510 ${ORTHANC_STONE_ROOT}/Sources/Viewport/IViewport.h
511
512 ${ORTHANC_STONE_ROOT}/Sources/Volumes/IGeometryProvider.h
513 ${ORTHANC_STONE_ROOT}/Sources/Volumes/IVolumeSlicer.cpp
514 ${ORTHANC_STONE_ROOT}/Sources/Volumes/IVolumeSlicer.h
515 ${ORTHANC_STONE_ROOT}/Sources/Volumes/OrientedVolumeBoundingBox.cpp
516 ${ORTHANC_STONE_ROOT}/Sources/Volumes/OrientedVolumeBoundingBox.h
517
518 ${ORTHANC_STONE_ROOT}/Sources/Volumes/VolumeImageGeometry.cpp
519 ${ORTHANC_STONE_ROOT}/Sources/Volumes/VolumeImageGeometry.h
520 ${ORTHANC_STONE_ROOT}/Sources/Volumes/VolumeReslicer.cpp
521 ${ORTHANC_STONE_ROOT}/Sources/Volumes/VolumeReslicer.h
522 ${ORTHANC_STONE_ROOT}/Sources/Volumes/VolumeSceneLayerSource.cpp
523 ${ORTHANC_STONE_ROOT}/Sources/Volumes/VolumeSceneLayerSource.h
524 ${ORTHANC_STONE_ROOT}/Sources/Volumes/DicomStructureSetSlicer2.cpp
525 ${ORTHANC_STONE_ROOT}/Sources/Volumes/DicomStructureSetSlicer2.h
526 ${ORTHANC_STONE_ROOT}/Sources/Volumes/DicomVolumeImage.h
527 ${ORTHANC_STONE_ROOT}/Sources/Volumes/DicomVolumeImage.cpp
528 ${ORTHANC_STONE_ROOT}/Sources/Volumes/DicomVolumeImage.h
529 ${ORTHANC_STONE_ROOT}/Sources/Volumes/DicomVolumeImageMPRSlicer.cpp
530 ${ORTHANC_STONE_ROOT}/Sources/Volumes/DicomVolumeImageMPRSlicer.h
531 ${ORTHANC_STONE_ROOT}/Sources/Volumes/DicomVolumeImageReslicer.cpp
532 ${ORTHANC_STONE_ROOT}/Sources/Volumes/DicomVolumeImageReslicer.h
533 ${ORTHANC_STONE_ROOT}/Sources/Volumes/ImageBuffer3D.cpp
534 ${ORTHANC_STONE_ROOT}/Sources/Volumes/ImageBuffer3D.h
535
536 ${ORTHANC_STONE_ROOT}/Sources/Wrappers/CairoContext.cpp
537 ${ORTHANC_STONE_ROOT}/Sources/Wrappers/CairoSurface.cpp
538
539 ${PLATFORM_SOURCES}
540 ${APPLICATIONS_SOURCES}
541 ${ORTHANC_CORE_SOURCES}
542 ${ORTHANC_DICOM_SOURCES}
543
544 # Mandatory components
545 ${CAIRO_SOURCES}
546 ${FREETYPE_SOURCES}
547 ${PIXMAN_SOURCES}
548
549 # Optional components
550 ${SDL_SOURCES}
551 ${QT_SOURCES}
552 ${GLEW_SOURCES}
553 )
554
555
556 if (ENABLE_OPENGL)
557 list(APPEND ORTHANC_STONE_SOURCES
558 ${ORTHANC_STONE_ROOT}/Sources/Fonts/OpenGLTextCoordinates.h
559 ${ORTHANC_STONE_ROOT}/Sources/Fonts/OpenGLTextCoordinates.cpp
560 ${ORTHANC_STONE_ROOT}/Sources/OpenGL/OpenGLProgram.h
561 ${ORTHANC_STONE_ROOT}/Sources/OpenGL/OpenGLProgram.cpp
562 ${ORTHANC_STONE_ROOT}/Sources/OpenGL/OpenGLShader.h
563 ${ORTHANC_STONE_ROOT}/Sources/OpenGL/OpenGLShader.cpp
564 ${ORTHANC_STONE_ROOT}/Sources/OpenGL/OpenGLTexture.h
565 ${ORTHANC_STONE_ROOT}/Sources/OpenGL/OpenGLTexture.cpp
566 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/OpenGLCompositor.h
567 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/OpenGLCompositor.cpp
568
569 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLAdvancedPolylineRenderer.cpp
570 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLAdvancedPolylineRenderer.h
571 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLBasicPolylineRenderer.cpp
572 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLBasicPolylineRenderer.h
573 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLColorTextureProgram.cpp
574 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLColorTextureProgram.h
575 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLColorTextureRenderer.cpp
576 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLColorTextureRenderer.h
577 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLFloatTextureProgram.cpp
578 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLFloatTextureProgram.h
579 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLFloatTextureRenderer.cpp
580 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLFloatTextureRenderer.h
581 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLInfoPanelRenderer.cpp
582 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLInfoPanelRenderer.h
583 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLLinesProgram.cpp
584 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLLinesProgram.h
585 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLLookupTableTextureRenderer.cpp
586 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLLookupTableTextureRenderer.h
587 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLShaderVersionDirective.h
588 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLTextProgram.cpp
589 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLTextProgram.h
590 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLTextRenderer.cpp
591 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLTextRenderer.h
592 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLTextureProgram.cpp
593 ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLTextureProgram.h
594 )
595
596 if (ENABLE_WASM)
597 list(APPEND ORTHANC_STONE_SOURCES
598 ${ORTHANC_STONE_ROOT}/Sources/OpenGL/WebAssemblyOpenGLContext.cpp
599 ${ORTHANC_STONE_ROOT}/Sources/OpenGL/WebAssemblyOpenGLContext.h
600 ${ORTHANC_STONE_ROOT}/Sources/Viewport/WebGLViewport.cpp
601 ${ORTHANC_STONE_ROOT}/Sources/Viewport/WebGLViewportsRegistry.cpp
602 )
603 endif()
604 endif()
605
606 ##
607 ## TEST - Automatically add all ".h" headers to the list of sources
608 ##
609
610 macro(AutodetectHeaderFiles SOURCES_VAR)
611 set(TMP)
612
613 foreach(f IN LISTS ${SOURCES_VAR})
614 get_filename_component(_base ${f} NAME_WE)
615 get_filename_component(_dir ${f} DIRECTORY)
616 get_filename_component(_extension ${f} EXT)
617 set(_header ${_dir}/${_base}.h)
618
619 if ((_extension STREQUAL ".cpp" OR
620 _extension STREQUAL ".cc" OR
621 _extension STREQUAL ".h") AND
622 EXISTS ${_header} AND
623 NOT IS_DIRECTORY ${_header} AND
624 NOT IS_SYMLINK ${_header})
625
626 # Prevent adding the header twice if it is already manually
627 # specified in the sources
628 list (FIND SOURCES_VAR ${_header} _index)
629 if (${_index} EQUAL -1)
630 list(APPEND TMP ${_header})
631 endif()
632 endif()
633 endforeach()
634
635 list(APPEND ${SOURCES_VAR} ${TMP})
636 endmacro()
637
638
639 AutodetectHeaderFiles(ORTHANC_STONE_SOURCES)