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