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