2691
|
1 cmake_minimum_required(VERSION 2.8)
|
|
2
|
|
3 project(Orthanc)
|
|
4
|
|
5
|
|
6 #####################################################################
|
|
7 ## Generic parameters of the Orthanc framework
|
|
8 #####################################################################
|
|
9
|
|
10 include(${CMAKE_SOURCE_DIR}/Resources/CMake/OrthancFrameworkParameters.cmake)
|
|
11
|
|
12 # Enable all the optional components of the Orthanc framework
|
|
13 set(ENABLE_CRYPTO_OPTIONS ON)
|
|
14 set(ENABLE_DCMTK ON)
|
|
15 set(ENABLE_DCMTK_NETWORKING ON)
|
|
16 set(ENABLE_GOOGLE_TEST ON)
|
|
17 set(ENABLE_JPEG ON)
|
|
18 set(ENABLE_LOCALE ON)
|
|
19 set(ENABLE_LUA ON)
|
|
20 set(ENABLE_PNG ON)
|
|
21 set(ENABLE_PUGIXML ON)
|
|
22 set(ENABLE_SQLITE ON)
|
|
23 set(ENABLE_WEB_CLIENT ON)
|
|
24 set(ENABLE_WEB_SERVER ON)
|
|
25 set(ENABLE_ZLIB ON)
|
|
26
|
|
27 set(HAS_EMBEDDED_RESOURCES ON)
|
|
28
|
|
29
|
|
30 #####################################################################
|
|
31 ## CMake parameters tunable at the command line to configure the
|
|
32 ## plugins, the companion tools, and the unit tests
|
|
33 #####################################################################
|
|
34
|
|
35 # Parameters of the build
|
|
36 SET(BUILD_MODALITY_WORKLISTS ON CACHE BOOL "Whether to build the sample plugin to serve modality worklists")
|
|
37 SET(BUILD_RECOVER_COMPRESSED_FILE ON CACHE BOOL "Whether to build the companion tool to recover files compressed using Orthanc")
|
|
38 SET(BUILD_SERVE_FOLDERS ON CACHE BOOL "Whether to build the ServeFolders plugin")
|
|
39 SET(ENABLE_PLUGINS ON CACHE BOOL "Enable plugins")
|
|
40 SET(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests")
|
|
41
|
|
42
|
|
43 #####################################################################
|
|
44 ## Configuration of the Orthanc framework
|
|
45 #####################################################################
|
|
46
|
|
47 include(${CMAKE_SOURCE_DIR}/Resources/CMake/VisualStudioPrecompiledHeaders.cmake)
|
|
48 include(${CMAKE_SOURCE_DIR}/Resources/CMake/OrthancFrameworkConfiguration.cmake)
|
|
49
|
|
50
|
|
51 #####################################################################
|
|
52 ## List of source files
|
|
53 #####################################################################
|
|
54
|
|
55 set(ORTHANC_SERVER_SOURCES
|
|
56 OrthancServer/DatabaseWrapper.cpp
|
|
57 OrthancServer/DicomInstanceOrigin.cpp
|
|
58 OrthancServer/DicomInstanceToStore.cpp
|
|
59 OrthancServer/ExportedResource.cpp
|
|
60 OrthancServer/LuaScripting.cpp
|
|
61 OrthancServer/OrthancFindRequestHandler.cpp
|
|
62 OrthancServer/OrthancHttpHandler.cpp
|
|
63 OrthancServer/OrthancInitialization.cpp
|
|
64 OrthancServer/OrthancMoveRequestHandler.cpp
|
|
65 OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp
|
|
66 OrthancServer/OrthancRestApi/OrthancRestApi.cpp
|
|
67 OrthancServer/OrthancRestApi/OrthancRestArchive.cpp
|
|
68 OrthancServer/OrthancRestApi/OrthancRestChanges.cpp
|
|
69 OrthancServer/OrthancRestApi/OrthancRestModalities.cpp
|
|
70 OrthancServer/OrthancRestApi/OrthancRestResources.cpp
|
|
71 OrthancServer/OrthancRestApi/OrthancRestSystem.cpp
|
|
72 OrthancServer/QueryRetrieveHandler.cpp
|
|
73 OrthancServer/Search/HierarchicalMatcher.cpp
|
|
74 OrthancServer/Search/IFindConstraint.cpp
|
|
75 OrthancServer/Search/ListConstraint.cpp
|
|
76 OrthancServer/Search/LookupIdentifierQuery.cpp
|
|
77 OrthancServer/Search/LookupResource.cpp
|
|
78 OrthancServer/Search/RangeConstraint.cpp
|
|
79 OrthancServer/Search/SetOfResources.cpp
|
|
80 OrthancServer/Search/ValueConstraint.cpp
|
|
81 OrthancServer/Search/WildcardConstraint.cpp
|
|
82 OrthancServer/ServerContext.cpp
|
|
83 OrthancServer/ServerEnumerations.cpp
|
|
84 OrthancServer/ServerIndex.cpp
|
|
85 OrthancServer/ServerJobs/ArchiveJob.cpp
|
|
86 OrthancServer/ServerJobs/DicomModalityStoreJob.cpp
|
|
87 OrthancServer/ServerJobs/LuaJobManager.cpp
|
|
88 OrthancServer/ServerJobs/Operations/DeleteResourceOperation.cpp
|
|
89 OrthancServer/ServerJobs/Operations/ModifyInstanceOperation.cpp
|
|
90 OrthancServer/ServerJobs/Operations/StorePeerOperation.cpp
|
|
91 OrthancServer/ServerJobs/Operations/StoreScuOperation.cpp
|
|
92 OrthancServer/ServerJobs/Operations/SystemCallOperation.cpp
|
|
93 OrthancServer/ServerJobs/OrthancJobUnserializer.cpp
|
|
94 OrthancServer/ServerJobs/OrthancPeerStoreJob.cpp
|
|
95 OrthancServer/ServerJobs/ResourceModificationJob.cpp
|
|
96 OrthancServer/ServerToolbox.cpp
|
|
97 OrthancServer/SliceOrdering.cpp
|
|
98 )
|
|
99
|
|
100
|
|
101 set(ORTHANC_UNIT_TESTS_SOURCES
|
|
102 UnitTestsSources/DicomMapTests.cpp
|
|
103 UnitTestsSources/FileStorageTests.cpp
|
|
104 UnitTestsSources/FromDcmtkTests.cpp
|
|
105 UnitTestsSources/MemoryCacheTests.cpp
|
|
106 UnitTestsSources/ImageTests.cpp
|
|
107 UnitTestsSources/RestApiTests.cpp
|
|
108 UnitTestsSources/SQLiteTests.cpp
|
|
109 UnitTestsSources/SQLiteChromiumTests.cpp
|
|
110 UnitTestsSources/ServerIndexTests.cpp
|
|
111 UnitTestsSources/VersionsTests.cpp
|
|
112 UnitTestsSources/ZipTests.cpp
|
|
113 UnitTestsSources/LuaTests.cpp
|
|
114 UnitTestsSources/MultiThreadingTests.cpp
|
|
115 UnitTestsSources/UnitTestsMain.cpp
|
|
116 UnitTestsSources/ImageProcessingTests.cpp
|
|
117 UnitTestsSources/JpegLosslessTests.cpp
|
|
118 UnitTestsSources/StreamTests.cpp
|
|
119 )
|
|
120
|
|
121
|
|
122 if (ENABLE_PLUGINS)
|
|
123 list(APPEND ORTHANC_SERVER_SOURCES
|
|
124 Plugins/Engine/OrthancPluginDatabase.cpp
|
|
125 Plugins/Engine/OrthancPlugins.cpp
|
|
126 Plugins/Engine/PluginsEnumerations.cpp
|
|
127 Plugins/Engine/PluginsErrorDictionary.cpp
|
|
128 Plugins/Engine/PluginsManager.cpp
|
|
129 )
|
|
130
|
|
131 list(APPEND ORTHANC_UNIT_TESTS_SOURCES
|
|
132 UnitTestsSources/PluginsTests.cpp
|
|
133 )
|
|
134 endif()
|
|
135
|
|
136
|
|
137 if (CMAKE_COMPILER_IS_GNUCXX
|
|
138 AND NOT CMAKE_CROSSCOMPILING
|
|
139 AND USE_DCMTK_360)
|
|
140 # Add the "-pedantic" flag only on the Orthanc sources, and only if
|
|
141 # cross-compiling DCMTK 3.6.0
|
|
142 set(ORTHANC_ALL_SOURCES
|
|
143 ${ORTHANC_CORE_SOURCES_INTERNAL}
|
|
144 ${ORTHANC_DICOM_SOURCES_INTERNAL}
|
|
145 ${ORTHANC_SERVER_SOURCES}
|
|
146 ${ORTHANC_UNIT_TESTS_SOURCES}
|
|
147 Plugins/Samples/ServeFolders/Plugin.cpp
|
|
148 Plugins/Samples/ModalityWorklists/Plugin.cpp
|
|
149 OrthancServer/main.cpp
|
|
150 )
|
|
151
|
|
152 set_source_files_properties(${ORTHANC_ALL_SOURCES}
|
|
153 PROPERTIES COMPILE_FLAGS -pedantic
|
|
154 )
|
|
155 endif()
|
|
156
|
|
157
|
|
158 #####################################################################
|
|
159 ## Autogeneration of files
|
|
160 #####################################################################
|
|
161
|
|
162 set(ORTHANC_EMBEDDED_FILES
|
|
163 PREPARE_DATABASE ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/PrepareDatabase.sql
|
|
164 UPGRADE_DATABASE_3_TO_4 ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Upgrade3To4.sql
|
|
165 UPGRADE_DATABASE_4_TO_5 ${CMAKE_CURRENT_SOURCE_DIR}/OrthancServer/Upgrade4To5.sql
|
|
166 CONFIGURATION_SAMPLE ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Configuration.json
|
|
167 DICOM_CONFORMANCE_STATEMENT ${CMAKE_CURRENT_SOURCE_DIR}/Resources/DicomConformanceStatement.txt
|
|
168 LUA_TOOLBOX ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Toolbox.lua
|
|
169 FONT_UBUNTU_MONO_BOLD_16 ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Fonts/UbuntuMonoBold-16.json
|
|
170 )
|
|
171
|
|
172 if (STANDALONE_BUILD)
|
|
173 # We embed all the resources in the binaries for standalone builds
|
|
174 add_definitions(-DORTHANC_STANDALONE=1)
|
|
175 EmbedResources(
|
|
176 ${ORTHANC_EMBEDDED_FILES}
|
|
177 ORTHANC_EXPLORER ${CMAKE_CURRENT_SOURCE_DIR}/OrthancExplorer
|
|
178 ${DCMTK_DICTIONARIES}
|
|
179 )
|
|
180 else()
|
|
181 add_definitions(
|
|
182 -DORTHANC_STANDALONE=0
|
|
183 -DORTHANC_PATH=\"${CMAKE_SOURCE_DIR}\"
|
|
184 )
|
|
185 EmbedResources(
|
|
186 ${ORTHANC_EMBEDDED_FILES}
|
|
187 )
|
|
188 endif()
|
|
189
|
|
190 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
|
191 execute_process(
|
|
192 COMMAND
|
|
193 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py
|
|
194 ${ORTHANC_VERSION} Orthanc Orthanc.exe "Lightweight, RESTful DICOM server for medical imaging"
|
|
195 ERROR_VARIABLE Failure
|
|
196 OUTPUT_FILE ${AUTOGENERATED_DIR}/Orthanc.rc
|
|
197 )
|
|
198
|
|
199 if (Failure)
|
|
200 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
|
|
201 endif()
|
|
202
|
|
203 list(APPEND ORTHANC_RESOURCES ${AUTOGENERATED_DIR}/Orthanc.rc)
|
|
204 endif()
|
|
205
|
|
206
|
|
207
|
|
208 #####################################################################
|
|
209 ## Configuration of the C/C++ macros
|
|
210 #####################################################################
|
|
211
|
|
212 if (ENABLE_PLUGINS)
|
|
213 add_definitions(-DORTHANC_ENABLE_PLUGINS=1)
|
|
214 else()
|
|
215 add_definitions(-DORTHANC_ENABLE_PLUGINS=0)
|
|
216 endif()
|
|
217
|
|
218
|
|
219 if (UNIT_TESTS_WITH_HTTP_CONNEXIONS)
|
|
220 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=1)
|
|
221 else()
|
|
222 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=0)
|
|
223 endif()
|
|
224
|
|
225
|
|
226 include_directories(${CMAKE_SOURCE_DIR}/Plugins/Include)
|
|
227
|
|
228 add_definitions(
|
|
229 -DORTHANC_BUILD_UNIT_TESTS=1
|
|
230 -DORTHANC_ENABLE_LOGGING_PLUGIN=0
|
|
231
|
|
232 # Macros for the plugins
|
|
233 -DHAS_ORTHANC_EXCEPTION=0
|
|
234 -DMODALITY_WORKLISTS_VERSION="${ORTHANC_VERSION}"
|
|
235 -DSERVE_FOLDERS_VERSION="${ORTHANC_VERSION}"
|
|
236 )
|
|
237
|
|
238
|
|
239 # Setup precompiled headers for Microsoft Visual Studio
|
|
240
|
|
241 # WARNING: There must be NO MORE "add_definitions()", "include()" or
|
|
242 # "include_directories()" below, otherwise the generated precompiled
|
|
243 # headers might get broken!
|
|
244
|
|
245 if (MSVC)
|
|
246 add_definitions(-DORTHANC_USE_PRECOMPILED_HEADERS=1)
|
|
247
|
|
248 set(TMP
|
|
249 ${ORTHANC_CORE_SOURCES_INTERNAL}
|
|
250 ${ORTHANC_DICOM_SOURCES_INTERNAL}
|
|
251 )
|
|
252
|
|
253 ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS(
|
|
254 "PrecompiledHeaders.h" "Core/PrecompiledHeaders.cpp"
|
|
255 TMP ORTHANC_CORE_PCH)
|
|
256
|
|
257 ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS(
|
|
258 "PrecompiledHeadersServer.h" "OrthancServer/PrecompiledHeadersServer.cpp"
|
|
259 ORTHANC_SERVER_SOURCES ORTHANC_SERVER_PCH)
|
|
260
|
|
261 ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS(
|
|
262 "PrecompiledHeadersUnitTests.h" "UnitTestsSources/PrecompiledHeadersUnitTests.cpp"
|
|
263 ORTHANC_UNIT_TESTS_SOURCES ORTHANC_UNIT_TESTS_PCH)
|
|
264 endif()
|
|
265
|
|
266
|
|
267
|
|
268 #####################################################################
|
|
269 ## Build the core of Orthanc
|
|
270 #####################################################################
|
|
271
|
|
272 # "CoreLibrary" contains all the third-party dependencies and the
|
|
273 # content of the "Core" folder
|
|
274 add_library(CoreLibrary
|
|
275 STATIC
|
|
276 ${ORTHANC_CORE_PCH}
|
|
277 ${ORTHANC_CORE_SOURCES}
|
|
278 ${ORTHANC_DICOM_SOURCES}
|
|
279 ${AUTOGENERATED_SOURCES}
|
|
280 )
|
|
281
|
|
282
|
|
283 #####################################################################
|
|
284 ## Build the Orthanc server
|
|
285 #####################################################################
|
|
286
|
|
287 add_library(ServerLibrary
|
|
288 STATIC
|
|
289 ${ORTHANC_SERVER_PCH}
|
|
290 ${ORTHANC_SERVER_SOURCES}
|
|
291 )
|
|
292
|
|
293 # Ensure autogenerated code is built before building ServerLibrary
|
|
294 add_dependencies(ServerLibrary CoreLibrary)
|
|
295
|
|
296 add_executable(Orthanc
|
|
297 OrthancServer/main.cpp
|
|
298 ${ORTHANC_RESOURCES}
|
|
299 )
|
|
300
|
|
301 target_link_libraries(Orthanc ServerLibrary CoreLibrary ${DCMTK_LIBRARIES})
|
|
302
|
|
303 install(
|
|
304 TARGETS Orthanc
|
|
305 RUNTIME DESTINATION sbin
|
|
306 )
|
|
307
|
|
308
|
|
309 #####################################################################
|
|
310 ## Build the unit tests
|
|
311 #####################################################################
|
|
312
|
|
313 add_executable(UnitTests
|
|
314 ${GOOGLE_TEST_SOURCES}
|
|
315 ${ORTHANC_UNIT_TESTS_PCH}
|
|
316 ${ORTHANC_UNIT_TESTS_SOURCES}
|
|
317 )
|
|
318
|
|
319 target_link_libraries(UnitTests
|
|
320 ServerLibrary
|
|
321 CoreLibrary
|
|
322 ${DCMTK_LIBRARIES}
|
|
323 ${GOOGLE_TEST_LIBRARIES}
|
|
324 )
|
|
325
|
|
326
|
|
327 #####################################################################
|
|
328 ## Build the "ServeFolders" plugin
|
|
329 #####################################################################
|
|
330
|
|
331 if (ENABLE_PLUGINS AND BUILD_SERVE_FOLDERS)
|
|
332 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
|
333 execute_process(
|
|
334 COMMAND
|
|
335 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py
|
|
336 ${ORTHANC_VERSION} ServeFolders ServeFolders.dll "Orthanc plugin to serve additional folders"
|
|
337 ERROR_VARIABLE Failure
|
|
338 OUTPUT_FILE ${AUTOGENERATED_DIR}/ServeFolders.rc
|
|
339 )
|
|
340
|
|
341 if (Failure)
|
|
342 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
|
|
343 endif()
|
|
344
|
|
345 list(APPEND SERVE_FOLDERS_RESOURCES ${AUTOGENERATED_DIR}/ServeFolders.rc)
|
|
346 endif()
|
|
347
|
|
348 add_library(ServeFolders SHARED
|
|
349 ${BOOST_SOURCES}
|
|
350 ${JSONCPP_SOURCES}
|
|
351 ${LIBICONV_SOURCES}
|
|
352 Plugins/Samples/ServeFolders/Plugin.cpp
|
|
353 Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
|
|
354 ${SERVE_FOLDERS_RESOURCES}
|
|
355 )
|
|
356
|
|
357 set_target_properties(
|
|
358 ServeFolders PROPERTIES
|
|
359 VERSION ${ORTHANC_VERSION}
|
|
360 SOVERSION ${ORTHANC_VERSION}
|
|
361 )
|
|
362
|
|
363 install(
|
|
364 TARGETS ServeFolders
|
|
365 RUNTIME DESTINATION lib # Destination for Windows
|
|
366 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux
|
|
367 )
|
|
368 endif()
|
|
369
|
|
370
|
|
371
|
|
372 #####################################################################
|
|
373 ## Build the "ModalityWorklists" plugin
|
|
374 #####################################################################
|
|
375
|
|
376 if (ENABLE_PLUGINS AND BUILD_MODALITY_WORKLISTS)
|
|
377 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
|
378 execute_process(
|
|
379 COMMAND
|
|
380 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py
|
|
381 ${ORTHANC_VERSION} ModalityWorklists ModalityWorklists.dll "Sample Orthanc plugin to serve modality worklists"
|
|
382 ERROR_VARIABLE Failure
|
|
383 OUTPUT_FILE ${AUTOGENERATED_DIR}/ModalityWorklists.rc
|
|
384 )
|
|
385
|
|
386 if (Failure)
|
|
387 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
|
|
388 endif()
|
|
389
|
|
390 list(APPEND MODALITY_WORKLISTS_RESOURCES ${AUTOGENERATED_DIR}/ModalityWorklists.rc)
|
|
391 endif()
|
|
392
|
|
393 add_library(ModalityWorklists SHARED
|
|
394 ${BOOST_SOURCES}
|
|
395 ${JSONCPP_SOURCES}
|
|
396 ${LIBICONV_SOURCES}
|
|
397 Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
|
|
398 Plugins/Samples/ModalityWorklists/Plugin.cpp
|
|
399 ${MODALITY_WORKLISTS_RESOURCES}
|
|
400 )
|
|
401
|
|
402 set_target_properties(
|
|
403 ModalityWorklists PROPERTIES
|
|
404 VERSION ${ORTHANC_VERSION}
|
|
405 SOVERSION ${ORTHANC_VERSION}
|
|
406 )
|
|
407
|
|
408 install(
|
|
409 TARGETS ModalityWorklists
|
|
410 RUNTIME DESTINATION lib # Destination for Windows
|
|
411 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux
|
|
412 )
|
|
413 endif()
|
|
414
|
|
415
|
|
416
|
|
417 #####################################################################
|
|
418 ## Build the companion tool to recover files compressed using Orthanc
|
|
419 #####################################################################
|
|
420
|
|
421 if (BUILD_RECOVER_COMPRESSED_FILE)
|
|
422 set(RECOVER_COMPRESSED_SOURCES
|
|
423 Resources/Samples/Tools/RecoverCompressedFile.cpp
|
|
424 )
|
|
425
|
|
426 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
|
427 execute_process(
|
|
428 COMMAND
|
|
429 ${PYTHON_EXECUTABLE} ${ORTHANC_ROOT}/Resources/WindowsResources.py
|
|
430 ${ORTHANC_VERSION} OrthancRecoverCompressedFile OrthancRecoverCompressedFile.exe
|
|
431 "Lightweight, RESTful DICOM server for medical imaging"
|
|
432 ERROR_VARIABLE Failure
|
|
433 OUTPUT_FILE ${AUTOGENERATED_DIR}/OrthancRecoverCompressedFile.rc
|
|
434 )
|
|
435
|
|
436 if (Failure)
|
|
437 message(FATAL_ERROR "Error while computing the version information: ${Failure}")
|
|
438 endif()
|
|
439
|
|
440 list(APPEND RECOVER_COMPRESSED_SOURCES
|
|
441 ${AUTOGENERATED_DIR}/OrthancRecoverCompressedFile.rc
|
|
442 )
|
|
443 endif()
|
|
444
|
|
445 add_executable(OrthancRecoverCompressedFile ${RECOVER_COMPRESSED_SOURCES})
|
|
446
|
|
447 target_link_libraries(OrthancRecoverCompressedFile CoreLibrary)
|
|
448
|
|
449 install(
|
|
450 TARGETS OrthancRecoverCompressedFile
|
|
451 RUNTIME DESTINATION bin
|
|
452 )
|
|
453 endif()
|
|
454
|
|
455
|
|
456
|
|
457 #####################################################################
|
|
458 ## Generate the documentation if Doxygen is present
|
|
459 #####################################################################
|
|
460
|
|
461 find_package(Doxygen)
|
|
462 if (DOXYGEN_FOUND)
|
|
463 configure_file(
|
|
464 ${CMAKE_SOURCE_DIR}/Resources/Orthanc.doxygen
|
|
465 ${CMAKE_CURRENT_BINARY_DIR}/Orthanc.doxygen
|
|
466 @ONLY)
|
|
467
|
|
468 configure_file(
|
|
469 ${CMAKE_SOURCE_DIR}/Resources/OrthancPlugin.doxygen
|
|
470 ${CMAKE_CURRENT_BINARY_DIR}/OrthancPlugin.doxygen
|
|
471 @ONLY)
|
|
472
|
|
473 add_custom_target(doc
|
|
474 ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Orthanc.doxygen
|
|
475 COMMENT "Generating internal documentation with Doxygen" VERBATIM
|
|
476 )
|
|
477
|
|
478 add_custom_command(TARGET Orthanc
|
|
479 POST_BUILD
|
|
480 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/OrthancPlugin.doxygen
|
|
481 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
482 COMMENT "Generating plugin documentation with Doxygen" VERBATIM
|
|
483 )
|
|
484
|
|
485 install(
|
|
486 DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/OrthancPluginDocumentation/doc/
|
|
487 DESTINATION share/doc/orthanc/OrthancPlugin
|
|
488 )
|
|
489 else()
|
|
490 message("Doxygen not found. The documentation will not be built.")
|
|
491 endif()
|
|
492
|
|
493
|
|
494
|
|
495 #####################################################################
|
|
496 ## Install the plugin SDK
|
|
497 #####################################################################
|
|
498
|
|
499 if (ENABLE_PLUGINS)
|
|
500 install(
|
|
501 FILES
|
|
502 Plugins/Include/orthanc/OrthancCPlugin.h
|
|
503 Plugins/Include/orthanc/OrthancCDatabasePlugin.h
|
|
504 DESTINATION include/orthanc
|
|
505 )
|
|
506 endif()
|
|
507
|
|
508
|
|
509
|
|
510 #####################################################################
|
|
511 ## Prepare the "uninstall" target
|
|
512 ## http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F
|
|
513 #####################################################################
|
|
514
|
|
515 configure_file(
|
|
516 "${CMAKE_CURRENT_SOURCE_DIR}/Resources/CMake/Uninstall.cmake.in"
|
|
517 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
|
518 IMMEDIATE @ONLY)
|
|
519
|
|
520 add_custom_target(uninstall
|
|
521 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|