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