Mercurial > hg > orthanc
comparison OrthancServer/CMakeLists.txt @ 5807:8279eaab0d1d attach-custom-data
merged default -> attach-custom-data
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Tue, 24 Sep 2024 11:39:52 +0200 |
parents | 9770d537880d f7adfb22e20e |
children | 023a99146dd0 |
comparison
equal
deleted
inserted
replaced
5085:79f98ee4f04b | 5807:8279eaab0d1d |
---|---|
1 # Orthanc - A Lightweight, RESTful DICOM Store | 1 # Orthanc - A Lightweight, RESTful DICOM Store |
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | 2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
3 # Department, University Hospital of Liege, Belgium | 3 # Department, University Hospital of Liege, Belgium |
4 # Copyright (C) 2017-2022 Osimis S.A., Belgium | 4 # Copyright (C) 2017-2023 Osimis S.A., Belgium |
5 # Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium | 5 # Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
6 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium | |
6 # | 7 # |
7 # This program is free software: you can redistribute it and/or | 8 # This program is free software: you can redistribute it and/or |
8 # modify it under the terms of the GNU General Public License as | 9 # modify it under the terms of the GNU General Public License as |
9 # published by the Free Software Foundation, either version 3 of the | 10 # published by the Free Software Foundation, either version 3 of the |
10 # License, or (at your option) any later version. | 11 # License, or (at your option) any later version. |
60 SET(BUILD_SERVE_FOLDERS ON CACHE BOOL "Whether to build the ServeFolders plugin") | 61 SET(BUILD_SERVE_FOLDERS ON CACHE BOOL "Whether to build the ServeFolders plugin") |
61 SET(BUILD_CONNECTIVITY_CHECKS ON CACHE BOOL "Whether to build the ConnectivityChecks plugin") | 62 SET(BUILD_CONNECTIVITY_CHECKS ON CACHE BOOL "Whether to build the ConnectivityChecks plugin") |
62 SET(BUILD_HOUSEKEEPER ON CACHE BOOL "Whether to build the Housekeeper plugin") | 63 SET(BUILD_HOUSEKEEPER ON CACHE BOOL "Whether to build the Housekeeper plugin") |
63 SET(BUILD_DELAYED_DELETION ON CACHE BOOL "Whether to build the DelayedDeletion plugin") | 64 SET(BUILD_DELAYED_DELETION ON CACHE BOOL "Whether to build the DelayedDeletion plugin") |
64 SET(BUILD_ADVANCED_STORAGE ON CACHE BOOL "Whether to build the AdvancedStorage plugin") | 65 SET(BUILD_ADVANCED_STORAGE ON CACHE BOOL "Whether to build the AdvancedStorage plugin") |
66 SET(BUILD_MULTITENANT_DICOM ON CACHE BOOL "Whether to build the MultitenantDicom plugin") | |
65 SET(ENABLE_PLUGINS ON CACHE BOOL "Enable plugins") | 67 SET(ENABLE_PLUGINS ON CACHE BOOL "Enable plugins") |
66 SET(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests") | 68 SET(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests") |
67 | 69 |
68 | 70 |
69 ##################################################################### | 71 ##################################################################### |
70 ## Configuration of the Orthanc framework | 72 ## Configuration of the Orthanc framework |
71 ##################################################################### | 73 ##################################################################### |
72 | 74 |
75 if (ENABLE_PLUGINS) | |
76 set(ENABLE_PROTOBUF ON) | |
77 set(ENABLE_PROTOBUF_COMPILER ON) | |
78 endif() | |
79 | |
73 include(${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/CMake/VisualStudioPrecompiledHeaders.cmake) | 80 include(${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/CMake/VisualStudioPrecompiledHeaders.cmake) |
74 include(${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/CMake/OrthancFrameworkConfiguration.cmake) | 81 include(${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/CMake/OrthancFrameworkConfiguration.cmake) |
75 | 82 |
76 # To export the proper symbols in the sample plugins | 83 # To export the proper symbols in the sample plugins |
77 include(${CMAKE_SOURCE_DIR}/Plugins/Samples/Common/OrthancPluginsExports.cmake) | 84 include(${CMAKE_SOURCE_DIR}/Plugins/Samples/Common/OrthancPluginsExports.cmake) |
80 ##################################################################### | 87 ##################################################################### |
81 ## List of source files | 88 ## List of source files |
82 ##################################################################### | 89 ##################################################################### |
83 | 90 |
84 set(ORTHANC_SERVER_SOURCES | 91 set(ORTHANC_SERVER_SOURCES |
92 ${CMAKE_SOURCE_DIR}/Sources/Database/BaseDatabaseWrapper.cpp | |
85 ${CMAKE_SOURCE_DIR}/Sources/Database/Compatibility/DatabaseLookup.cpp | 93 ${CMAKE_SOURCE_DIR}/Sources/Database/Compatibility/DatabaseLookup.cpp |
86 ${CMAKE_SOURCE_DIR}/Sources/Database/Compatibility/ICreateInstance.cpp | 94 ${CMAKE_SOURCE_DIR}/Sources/Database/Compatibility/ICreateInstance.cpp |
87 ${CMAKE_SOURCE_DIR}/Sources/Database/Compatibility/IGetChildrenMetadata.cpp | 95 ${CMAKE_SOURCE_DIR}/Sources/Database/Compatibility/IGetChildrenMetadata.cpp |
88 ${CMAKE_SOURCE_DIR}/Sources/Database/Compatibility/ILookupResourceAndParent.cpp | 96 ${CMAKE_SOURCE_DIR}/Sources/Database/Compatibility/ILookupResourceAndParent.cpp |
89 ${CMAKE_SOURCE_DIR}/Sources/Database/Compatibility/ILookupResources.cpp | 97 ${CMAKE_SOURCE_DIR}/Sources/Database/Compatibility/ILookupResources.cpp |
135 ${CMAKE_SOURCE_DIR}/Sources/ServerJobs/OrthancJobUnserializer.cpp | 143 ${CMAKE_SOURCE_DIR}/Sources/ServerJobs/OrthancJobUnserializer.cpp |
136 ${CMAKE_SOURCE_DIR}/Sources/ServerJobs/OrthancPeerStoreJob.cpp | 144 ${CMAKE_SOURCE_DIR}/Sources/ServerJobs/OrthancPeerStoreJob.cpp |
137 ${CMAKE_SOURCE_DIR}/Sources/ServerJobs/ResourceModificationJob.cpp | 145 ${CMAKE_SOURCE_DIR}/Sources/ServerJobs/ResourceModificationJob.cpp |
138 ${CMAKE_SOURCE_DIR}/Sources/ServerJobs/SplitStudyJob.cpp | 146 ${CMAKE_SOURCE_DIR}/Sources/ServerJobs/SplitStudyJob.cpp |
139 ${CMAKE_SOURCE_DIR}/Sources/ServerJobs/StorageCommitmentScpJob.cpp | 147 ${CMAKE_SOURCE_DIR}/Sources/ServerJobs/StorageCommitmentScpJob.cpp |
148 ${CMAKE_SOURCE_DIR}/Sources/ServerJobs/ThreadedSetOfInstancesJob.cpp | |
140 ${CMAKE_SOURCE_DIR}/Sources/ServerToolbox.cpp | 149 ${CMAKE_SOURCE_DIR}/Sources/ServerToolbox.cpp |
141 ${CMAKE_SOURCE_DIR}/Sources/SliceOrdering.cpp | 150 ${CMAKE_SOURCE_DIR}/Sources/SliceOrdering.cpp |
142 ${CMAKE_SOURCE_DIR}/Sources/StorageCommitmentReports.cpp | 151 ${CMAKE_SOURCE_DIR}/Sources/StorageCommitmentReports.cpp |
143 ) | 152 ) |
144 | 153 |
221 ##################################################################### | 230 ##################################################################### |
222 ## Autogeneration of files | 231 ## Autogeneration of files |
223 ##################################################################### | 232 ##################################################################### |
224 | 233 |
225 set(ORTHANC_EMBEDDED_FILES | 234 set(ORTHANC_EMBEDDED_FILES |
226 CONFIGURATION_SAMPLE ${CMAKE_SOURCE_DIR}/Resources/Configuration.json | 235 CONFIGURATION_SAMPLE ${CMAKE_SOURCE_DIR}/Resources/Configuration.json |
227 DICOM_CONFORMANCE_STATEMENT ${CMAKE_SOURCE_DIR}/Resources/DicomConformanceStatement.txt | 236 DICOM_CONFORMANCE_STATEMENT ${CMAKE_SOURCE_DIR}/Resources/DicomConformanceStatement.txt |
228 FONT_UBUNTU_MONO_BOLD_16 ${CMAKE_SOURCE_DIR}/Resources/Fonts/UbuntuMonoBold-16.json | 237 FONT_UBUNTU_MONO_BOLD_16 ${CMAKE_SOURCE_DIR}/Resources/Fonts/UbuntuMonoBold-16.json |
229 LUA_TOOLBOX ${CMAKE_SOURCE_DIR}/Resources/Toolbox.lua | 238 LUA_TOOLBOX ${CMAKE_SOURCE_DIR}/Resources/Toolbox.lua |
230 PREPARE_DATABASE ${CMAKE_SOURCE_DIR}/Sources/Database/PrepareDatabase.sql | 239 PREPARE_DATABASE ${CMAKE_SOURCE_DIR}/Sources/Database/PrepareDatabase.sql |
231 UPGRADE_DATABASE_3_TO_4 ${CMAKE_SOURCE_DIR}/Sources/Database/Upgrade3To4.sql | 240 UPGRADE_DATABASE_3_TO_4 ${CMAKE_SOURCE_DIR}/Sources/Database/Upgrade3To4.sql |
232 UPGRADE_DATABASE_4_TO_5 ${CMAKE_SOURCE_DIR}/Sources/Database/Upgrade4To5.sql | 241 UPGRADE_DATABASE_4_TO_5 ${CMAKE_SOURCE_DIR}/Sources/Database/Upgrade4To5.sql |
233 INSTALL_REVISION_AND_CUSTOM_DATA | 242 INSTALL_TRACK_ATTACHMENTS_SIZE ${CMAKE_SOURCE_DIR}/Sources/Database/InstallTrackAttachmentsSize.sql |
234 ${CMAKE_SOURCE_DIR}/Sources/Database/InstallRevisionAndCustomData.sql | 243 INSTALL_LABELS_TABLE ${CMAKE_SOURCE_DIR}/Sources/Database/InstallLabelsTable.sql |
235 | 244 INSTALL_REVISION_AND_CUSTOM_DATA ${CMAKE_SOURCE_DIR}/Sources/Database/InstallRevisionAndCustomData.sql |
236 INSTALL_TRACK_ATTACHMENTS_SIZE | |
237 ${CMAKE_SOURCE_DIR}/Sources/Database/InstallTrackAttachmentsSize.sql | |
238 ) | 245 ) |
239 | 246 |
240 if (STANDALONE_BUILD) | 247 if (STANDALONE_BUILD) |
241 # We embed all the resources in the binaries for standalone builds | 248 # We embed all the resources in the binaries for standalone builds |
242 add_definitions( | 249 add_definitions( |
282 ##################################################################### | 289 ##################################################################### |
283 ## Configuration of the C/C++ macros | 290 ## Configuration of the C/C++ macros |
284 ##################################################################### | 291 ##################################################################### |
285 | 292 |
286 check_symbol_exists(mallopt "malloc.h" HAVE_MALLOPT) | 293 check_symbol_exists(mallopt "malloc.h" HAVE_MALLOPT) |
294 check_symbol_exists(malloc_trim "malloc.h" HAVE_MALLOC_TRIM) | |
287 | 295 |
288 if (HAVE_MALLOPT) | 296 if (HAVE_MALLOPT) |
289 add_definitions(-DHAVE_MALLOPT=1) | 297 add_definitions(-DHAVE_MALLOPT=1) |
290 else() | 298 else() |
291 add_definitions(-DHAVE_MALLOPT=0) | 299 add_definitions(-DHAVE_MALLOPT=0) |
292 endif() | 300 endif() |
293 | 301 |
302 if (HAVE_MALLOC_TRIM) | |
303 add_definitions(-DHAVE_MALLOC_TRIM=1) | |
304 else() | |
305 add_definitions(-DHAVE_MALLOC_TRIM=0) | |
306 endif() | |
294 | 307 |
295 if (STATIC_BUILD) | 308 if (STATIC_BUILD) |
296 add_definitions(-DORTHANC_STATIC=1) | 309 add_definitions(-DORTHANC_STATIC=1) |
297 else() | 310 else() |
298 add_definitions(-DORTHANC_STATIC=0) | 311 add_definitions(-DORTHANC_STATIC=0) |
314 | 327 |
315 | 328 |
316 add_definitions( | 329 add_definitions( |
317 -DORTHANC_BUILD_UNIT_TESTS=1 | 330 -DORTHANC_BUILD_UNIT_TESTS=1 |
318 -DORTHANC_BUILDING_SERVER_LIBRARY=1 | 331 -DORTHANC_BUILDING_SERVER_LIBRARY=1 |
319 | 332 |
320 # Macros for the plugins | 333 # Macros for the plugins |
321 -DHAS_ORTHANC_EXCEPTION=0 | 334 -DHAS_ORTHANC_EXCEPTION=0 |
322 -DMODALITY_WORKLISTS_VERSION="${ORTHANC_VERSION}" | |
323 -DSERVE_FOLDERS_VERSION="${ORTHANC_VERSION}" | |
324 -DHOUSEKEEPER_VERSION="${ORTHANC_VERSION}" | |
325 -DADVANCED_STORAGE_VERSION="${ORTHANC_VERSION}" | |
326 ) | 335 ) |
327 | 336 |
328 | 337 |
329 # Setup precompiled headers for Microsoft Visual Studio | 338 # Setup precompiled headers for Microsoft Visual Studio |
330 | 339 |
332 # "include_directories()" below, otherwise the generated precompiled | 341 # "include_directories()" below, otherwise the generated precompiled |
333 # headers might get broken! | 342 # headers might get broken! |
334 | 343 |
335 if (MSVC) | 344 if (MSVC) |
336 add_definitions(-DORTHANC_USE_PRECOMPILED_HEADERS=1) | 345 add_definitions(-DORTHANC_USE_PRECOMPILED_HEADERS=1) |
337 | 346 |
338 set(TMP | 347 set(TMP |
339 ${ORTHANC_CORE_SOURCES_INTERNAL} | 348 ${ORTHANC_CORE_SOURCES_INTERNAL} |
340 ${ORTHANC_DICOM_SOURCES_INTERNAL} | 349 ${ORTHANC_DICOM_SOURCES_INTERNAL} |
341 ) | 350 ) |
342 | 351 |
357 | 366 |
358 ##################################################################### | 367 ##################################################################### |
359 ## Build the core of Orthanc | 368 ## Build the core of Orthanc |
360 ##################################################################### | 369 ##################################################################### |
361 | 370 |
371 add_custom_target(AutogeneratedTarget | |
372 DEPENDS | |
373 ${AUTOGENERATED_SOURCES} | |
374 ) | |
375 | |
362 # "CoreLibrary" contains all the third-party dependencies and the | 376 # "CoreLibrary" contains all the third-party dependencies and the |
363 # content of the "Core" folder | 377 # content of the "OrthancFramework" folder |
364 add_library(CoreLibrary | 378 add_library(CoreLibrary |
365 STATIC | 379 STATIC |
366 ${ORTHANC_CORE_PCH} | 380 ${ORTHANC_CORE_PCH} |
367 ${ORTHANC_CORE_SOURCES} | 381 ${ORTHANC_CORE_SOURCES} |
368 ${ORTHANC_DICOM_SOURCES} | 382 ${ORTHANC_DICOM_SOURCES} |
369 ${AUTOGENERATED_SOURCES} | 383 ${AUTOGENERATED_SOURCES} |
370 ) | 384 ) |
371 | 385 |
386 DefineSourceBasenameForTarget(CoreLibrary) | |
387 | |
388 add_dependencies(CoreLibrary AutogeneratedTarget) | |
389 | |
372 if (LIBICU_LIBRARIES) | 390 if (LIBICU_LIBRARIES) |
373 target_link_libraries(CoreLibrary ${LIBICU_LIBRARIES}) | 391 target_link_libraries(CoreLibrary ${LIBICU_LIBRARIES}) |
374 endif() | 392 endif() |
375 | 393 |
376 | 394 |
377 ##################################################################### | 395 ##################################################################### |
378 ## Build the Orthanc server | 396 ## Build the Orthanc server |
379 ##################################################################### | 397 ##################################################################### |
398 | |
399 if (ENABLE_PLUGINS) | |
400 add_custom_command( | |
401 COMMAND | |
402 ${PROTOC_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Plugins/Include/orthanc/OrthancDatabasePlugin.proto --cpp_out=${AUTOGENERATED_DIR} -I${CMAKE_SOURCE_DIR}/Plugins/Include/orthanc | |
403 COMMAND | |
404 ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Resources/PreventProtobufDirectoryLeaks.py ${AUTOGENERATED_DIR}/OrthancDatabasePlugin.pb.cc | |
405 DEPENDS | |
406 ProtobufCompiler | |
407 ${CMAKE_SOURCE_DIR}/Resources/PreventProtobufDirectoryLeaks.py | |
408 ${CMAKE_SOURCE_DIR}/Plugins/Include/orthanc/OrthancDatabasePlugin.proto | |
409 OUTPUT | |
410 ${AUTOGENERATED_DIR}/OrthancDatabasePlugin.pb.cc | |
411 ${AUTOGENERATED_DIR}/OrthancDatabasePlugin.pb.h | |
412 ) | |
413 | |
414 add_custom_target(OrthancDatabaseProtobuf | |
415 DEPENDS | |
416 ${AUTOGENERATED_DIR}/OrthancDatabasePlugin.pb.h | |
417 ) | |
418 | |
419 list(APPEND ORTHANC_SERVER_SOURCES | |
420 ${AUTOGENERATED_DIR}/OrthancDatabasePlugin.pb.cc | |
421 ) | |
422 else() | |
423 add_custom_target(OrthancDatabaseProtobuf) | |
424 endif() | |
380 | 425 |
381 add_library(ServerLibrary | 426 add_library(ServerLibrary |
382 STATIC | 427 STATIC |
383 ${ORTHANC_SERVER_PCH} | 428 ${ORTHANC_SERVER_PCH} |
384 ${ORTHANC_SERVER_SOURCES} | 429 ${ORTHANC_SERVER_SOURCES} |
385 ) | 430 ) |
386 | 431 |
432 DefineSourceBasenameForTarget(ServerLibrary) | |
433 | |
387 # Ensure autogenerated code is built before building ServerLibrary | 434 # Ensure autogenerated code is built before building ServerLibrary |
388 add_dependencies(ServerLibrary CoreLibrary) | 435 add_dependencies(ServerLibrary CoreLibrary OrthancDatabaseProtobuf) |
389 | 436 |
390 add_executable(Orthanc | 437 add_executable(Orthanc |
391 ${CMAKE_SOURCE_DIR}/Sources/main.cpp | 438 ${CMAKE_SOURCE_DIR}/Sources/main.cpp |
392 ${ORTHANC_RESOURCES} | 439 ${ORTHANC_RESOURCES} |
393 ) | 440 ) |
441 | |
442 DefineSourceBasenameForTarget(Orthanc) | |
394 | 443 |
395 target_link_libraries(Orthanc ServerLibrary CoreLibrary ${DCMTK_LIBRARIES}) | 444 target_link_libraries(Orthanc ServerLibrary CoreLibrary ${DCMTK_LIBRARIES}) |
396 | 445 |
397 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") | 446 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") |
398 # The link flag below hides all the global functions so that a Linux | 447 # The link flag below hides all the global functions so that a Linux |
420 ${ORTHANC_FRAMEWORK_UNIT_TESTS} | 469 ${ORTHANC_FRAMEWORK_UNIT_TESTS} |
421 ${ORTHANC_SERVER_UNIT_TESTS} | 470 ${ORTHANC_SERVER_UNIT_TESTS} |
422 ${BOOST_EXTENDED_SOURCES} | 471 ${BOOST_EXTENDED_SOURCES} |
423 ) | 472 ) |
424 | 473 |
474 DefineSourceBasenameForTarget(UnitTests) | |
475 | |
425 target_link_libraries(UnitTests | 476 target_link_libraries(UnitTests |
426 ServerLibrary | 477 ServerLibrary |
427 CoreLibrary | 478 CoreLibrary |
428 ${DCMTK_LIBRARIES} | 479 ${DCMTK_LIBRARIES} |
429 ${GOOGLE_TEST_LIBRARIES} | 480 ${GOOGLE_TEST_LIBRARIES} |
430 ) | 481 ) |
431 | 482 |
432 | 483 |
433 ##################################################################### | 484 ##################################################################### |
434 ## Build a static library to share code between the plugins | 485 ## Static library to share third-party libraries between the plugins |
435 ##################################################################### | 486 ##################################################################### |
436 | 487 |
437 if (ENABLE_PLUGINS AND | 488 if (ENABLE_PLUGINS AND |
438 (BUILD_SERVE_FOLDERS OR BUILD_MODALITY_WORKLISTS OR BUILD_HOUSEKEEPER OR BUILD_ADVANCED_STORAGE)) | 489 (BUILD_SERVE_FOLDERS OR BUILD_MODALITY_WORKLISTS OR BUILD_HOUSEKEEPER OR |
439 add_library(ThirdPartyPlugins STATIC | 490 BUILD_DELAYED_DELETION OR BUILD_MULTITENANT_DICOM OR BUILD_ADVANCED_STORAGE)) |
491 set(PLUGINS_DEPENDENCIES_SOURCES | |
440 ${BOOST_SOURCES} | 492 ${BOOST_SOURCES} |
441 ${JSONCPP_SOURCES} | 493 ${JSONCPP_SOURCES} |
442 ${LIBICONV_SOURCES} | 494 ${LIBICONV_SOURCES} |
443 ${LIBICU_SOURCES} | 495 ${LIBICU_SOURCES} |
496 ${PUGIXML_SOURCES} | |
497 ${UUID_SOURCES} | |
498 ${ZLIB_SOURCES} | |
499 | |
500 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/ThirdParty/base64/base64.cpp | |
501 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/ThirdParty/md5/md5.c | |
444 Plugins/Samples/Common/OrthancPluginCppWrapper.cpp | 502 Plugins/Samples/Common/OrthancPluginCppWrapper.cpp |
445 ) | 503 ) |
446 | 504 |
447 if (LIBICU_LIBRARIES) | 505 if (BUILD_DELAYED_DELETION) |
448 target_link_libraries(ThirdPartyPlugins ${LIBICU_LIBRARIES}) | 506 list(APPEND PLUGINS_DEPENDENCIES_SOURCES |
507 ${SQLITE_SOURCES} | |
508 ) | |
449 endif() | 509 endif() |
510 | |
511 if (BUILD_MULTITENANT_DICOM) | |
512 list(APPEND PLUGINS_DEPENDENCIES_SOURCES | |
513 ${DCMTK_SOURCES} | |
514 ${OPENSSL_SOURCES} | |
515 ${LIBJPEG_SOURCES} | |
516 ${LIBPNG_SOURCES} | |
517 ) | |
518 endif() | |
519 | |
520 add_library(PluginsDependencies STATIC | |
521 ${PLUGINS_DEPENDENCIES_SOURCES} | |
522 ) | |
523 | |
524 DefineSourceBasenameForTarget(PluginsDependencies) | |
450 | 525 |
451 # Add the "-fPIC" option as this static library must be embedded | 526 # Add the "-fPIC" option as this static library must be embedded |
452 # inside shared libraries (important on UNIX) | 527 # inside shared libraries (important on UNIX) |
453 set_property( | 528 set_target_properties( |
454 TARGET ThirdPartyPlugins | 529 PluginsDependencies |
455 PROPERTY POSITION_INDEPENDENT_CODE ON | 530 PROPERTIES POSITION_INDEPENDENT_CODE ON |
456 ) | 531 ) |
457 endif() | 532 endif() |
458 | 533 |
459 | 534 |
460 ##################################################################### | 535 ##################################################################### |
476 endif() | 551 endif() |
477 | 552 |
478 list(APPEND SERVE_FOLDERS_RESOURCES ${AUTOGENERATED_DIR}/ServeFolders.rc) | 553 list(APPEND SERVE_FOLDERS_RESOURCES ${AUTOGENERATED_DIR}/ServeFolders.rc) |
479 endif() | 554 endif() |
480 | 555 |
556 set_source_files_properties( | |
557 ${CMAKE_SOURCE_DIR}/Plugins/Samples/ServeFolders/Plugin.cpp | |
558 PROPERTIES COMPILE_DEFINITIONS "SERVE_FOLDERS_VERSION=\"${ORTHANC_VERSION}\"" | |
559 ) | |
560 | |
481 add_library(ServeFolders SHARED | 561 add_library(ServeFolders SHARED |
482 ${CMAKE_SOURCE_DIR}/Plugins/Samples/ServeFolders/Plugin.cpp | 562 ${CMAKE_SOURCE_DIR}/Plugins/Samples/ServeFolders/Plugin.cpp |
483 ${SERVE_FOLDERS_RESOURCES} | 563 ${SERVE_FOLDERS_RESOURCES} |
484 ) | 564 ) |
485 | 565 |
486 target_link_libraries(ServeFolders ThirdPartyPlugins) | 566 DefineSourceBasenameForTarget(ServeFolders) |
567 | |
568 target_link_libraries(ServeFolders PluginsDependencies) | |
487 | 569 |
488 set_target_properties( | 570 set_target_properties( |
489 ServeFolders PROPERTIES | 571 ServeFolders PROPERTIES |
490 VERSION ${ORTHANC_VERSION} | 572 VERSION ${ORTHANC_VERSION} |
491 SOVERSION ${ORTHANC_VERSION} | 573 SOVERSION ${ORTHANC_VERSION} |
519 endif() | 601 endif() |
520 | 602 |
521 list(APPEND MODALITY_WORKLISTS_RESOURCES ${AUTOGENERATED_DIR}/ModalityWorklists.rc) | 603 list(APPEND MODALITY_WORKLISTS_RESOURCES ${AUTOGENERATED_DIR}/ModalityWorklists.rc) |
522 endif() | 604 endif() |
523 | 605 |
606 set_source_files_properties( | |
607 ${CMAKE_SOURCE_DIR}/Plugins/Samples/ModalityWorklists/Plugin.cpp | |
608 PROPERTIES COMPILE_DEFINITIONS "MODALITY_WORKLISTS_VERSION=\"${ORTHANC_VERSION}\"" | |
609 ) | |
610 | |
524 add_library(ModalityWorklists SHARED | 611 add_library(ModalityWorklists SHARED |
525 ${CMAKE_SOURCE_DIR}/Plugins/Samples/ModalityWorklists/Plugin.cpp | 612 ${CMAKE_SOURCE_DIR}/Plugins/Samples/ModalityWorklists/Plugin.cpp |
526 ${MODALITY_WORKLISTS_RESOURCES} | 613 ${MODALITY_WORKLISTS_RESOURCES} |
527 ) | 614 ) |
528 | 615 |
529 target_link_libraries(ModalityWorklists ThirdPartyPlugins) | 616 DefineSourceBasenameForTarget(ModalityWorklists) |
617 | |
618 target_link_libraries(ModalityWorklists PluginsDependencies) | |
530 | 619 |
531 set_target_properties( | 620 set_target_properties( |
532 ModalityWorklists PROPERTIES | 621 ModalityWorklists PROPERTIES |
533 VERSION ${ORTHANC_VERSION} | 622 VERSION ${ORTHANC_VERSION} |
534 SOVERSION ${ORTHANC_VERSION} | 623 SOVERSION ${ORTHANC_VERSION} |
540 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | 629 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux |
541 ) | 630 ) |
542 endif() | 631 endif() |
543 | 632 |
544 | 633 |
545 if (ENABLE_PLUGINS AND (BUILD_DELAYED_DELETION OR BUILD_CONNECTIVITY_CHECKS)) | |
546 include(ExternalProject) | |
547 | |
548 endif() | |
549 | |
550 | 634 |
551 ##################################################################### | 635 ##################################################################### |
552 ## Build the "ConnectivityChecks" plugin | 636 ## Build the "ConnectivityChecks" plugin |
553 ##################################################################### | 637 ##################################################################### |
554 | 638 |
555 if (ENABLE_PLUGINS AND BUILD_CONNECTIVITY_CHECKS) | 639 if (ENABLE_PLUGINS AND BUILD_CONNECTIVITY_CHECKS) |
556 | 640 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
557 set(ConnectivityChecksFlags) | 641 execute_process( |
558 | 642 COMMAND |
559 if (CMAKE_TOOLCHAIN_FILE) | 643 ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/WindowsResources.py |
560 # Take absolute path to the toolchain | 644 ${ORTHANC_VERSION} ConnectivityChecks ConnectivityChecks.dll "Orthanc plugin to show connectivity status" |
561 get_filename_component(TMP ${CMAKE_TOOLCHAIN_FILE} REALPATH BASE ${CMAKE_SOURCE_DIR}) | 645 ERROR_VARIABLE Failure |
562 list(APPEND ConnectivityChecksFlags -DCMAKE_TOOLCHAIN_FILE=${TMP}) | 646 OUTPUT_FILE ${AUTOGENERATED_DIR}/ConnectivityChecks.rc |
647 ) | |
648 | |
649 if (Failure) | |
650 message(FATAL_ERROR "Error while computing the version information: ${Failure}") | |
651 endif() | |
652 | |
653 list(APPEND CONNECTIVITY_CHECKS_RESOURCES ${AUTOGENERATED_DIR}/ConnectivityChecks.rc) | |
563 endif() | 654 endif() |
564 | 655 |
565 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") | 656 include(${CMAKE_SOURCE_DIR}/Plugins/Samples/ConnectivityChecks/JavaScriptLibraries.cmake) |
566 list(APPEND ConnectivityChecksFlags | 657 |
567 -DLSB_CC=${CMAKE_LSB_CC} | 658 EmbedResources( |
568 -DLSB_CXX=${CMAKE_LSB_CXX} | 659 --target=ConnectivityChecksResources |
660 --framework-path=${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources | |
661 WEB_RESOURCES ${CMAKE_SOURCE_DIR}/Plugins/Samples/ConnectivityChecks/WebResources | |
662 LIBRARIES ${CONNECTIVITY_CHECKS_JAVASCRIPT_DIR} | |
663 ) | |
664 | |
665 set_source_files_properties( | |
666 ${CMAKE_SOURCE_DIR}/Plugins/Samples/ConnectivityChecks/Plugin.cpp | |
667 PROPERTIES COMPILE_DEFINITIONS "ORTHANC_PLUGIN_NAME=\"connectivity-checks\";ORTHANC_PLUGIN_VERSION=\"${ORTHANC_VERSION}\"" | |
668 ) | |
669 | |
670 # The "OrthancFrameworkDependencies.cpp" file is used to bypass the | |
671 # precompiled headers if compiling with Visual Studio | |
672 add_library(ConnectivityChecks SHARED | |
673 ${AUTOGENERATED_DIR}/ConnectivityChecksResources.cpp | |
674 ${CMAKE_SOURCE_DIR}/Plugins/Samples/ConnectivityChecks/Plugin.cpp | |
675 | |
676 ${CMAKE_SOURCE_DIR}/Plugins/Samples/ConnectivityChecks/OrthancFrameworkDependencies.cpp | |
677 ${CONNECTIVITY_CHECKS_RESOURCES} | |
678 ) | |
679 | |
680 DefineSourceBasenameForTarget(ConnectivityChecks) | |
681 | |
682 target_link_libraries(ConnectivityChecks PluginsDependencies) | |
683 | |
684 set_target_properties( | |
685 ConnectivityChecks PROPERTIES | |
686 VERSION ${ORTHANC_VERSION} | |
687 SOVERSION ${ORTHANC_VERSION} | |
688 ) | |
689 | |
690 install( | |
691 TARGETS ConnectivityChecks | |
692 RUNTIME DESTINATION lib # Destination for Windows | |
693 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | |
694 ) | |
695 endif() | |
696 | |
697 | |
698 ##################################################################### | |
699 ## Build the "DelayedDeletion" plugin | |
700 ##################################################################### | |
701 | |
702 if (ENABLE_PLUGINS AND BUILD_DELAYED_DELETION) | |
703 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
704 execute_process( | |
705 COMMAND | |
706 ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/WindowsResources.py | |
707 ${ORTHANC_VERSION} DelayedDeletion DelayedDeletion.dll "Orthanc plugin to delay deletion of files" | |
708 ERROR_VARIABLE Failure | |
709 OUTPUT_FILE ${AUTOGENERATED_DIR}/DelayedDeletion.rc | |
569 ) | 710 ) |
711 | |
712 if (Failure) | |
713 message(FATAL_ERROR "Error while computing the version information: ${Failure}") | |
714 endif() | |
715 | |
716 list(APPEND DELAYED_DELETION_RESOURCES ${AUTOGENERATED_DIR}/DelayedDeletion.rc) | |
570 endif() | 717 endif() |
571 | 718 |
572 externalproject_add(ConnectivityChecks | 719 set_source_files_properties( |
573 SOURCE_DIR "${CMAKE_SOURCE_DIR}/Plugins/Samples/ConnectivityChecks" | 720 ${CMAKE_SOURCE_DIR}/Plugins/Samples/DelayedDeletion/Plugin.cpp |
574 | 721 PROPERTIES COMPILE_DEFINITIONS "ORTHANC_PLUGIN_NAME=\"delayed-deletion\";ORTHANC_PLUGIN_VERSION=\"${ORTHANC_VERSION}\"" |
575 # We explicitly provide a build directory, in order to avoid paths | 722 ) |
576 # that are too long on our Visual Studio 2008 CIS | 723 |
577 BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/ConnectivityChecks-build" | 724 # The "OrthancFrameworkDependencies.cpp" file is used to bypass the |
578 | 725 # precompiled headers if compiling with Visual Studio |
579 # this helps triggering build when changing the external project | 726 add_library(DelayedDeletion SHARED |
580 BUILD_ALWAYS 1 | 727 ${CMAKE_SOURCE_DIR}/Plugins/Samples/DelayedDeletion/PendingDeletionsDatabase.cpp |
581 | 728 ${CMAKE_SOURCE_DIR}/Plugins/Samples/DelayedDeletion/Plugin.cpp |
582 CMAKE_ARGS | 729 |
583 -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} | 730 ${CMAKE_SOURCE_DIR}/Plugins/Samples/DelayedDeletion/OrthancFrameworkDependencies.cpp |
584 -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR} | 731 ${DELAYED_DELETION_RESOURCES} |
585 -DPLUGIN_VERSION=${ORTHANC_VERSION} | 732 ) |
586 -DSTATIC_BUILD=${STATIC_BUILD} | 733 |
587 -DALLOW_DOWNLOADS=${ALLOW_DOWNLOADS} | 734 DefineSourceBasenameForTarget(DelayedDeletion) |
588 -DUSE_SYSTEM_BOOST=${USE_SYSTEM_BOOST} | 735 |
589 -DUSE_LEGACY_JSONCPP=${USE_LEGACY_JSONCPP} | 736 target_link_libraries(DelayedDeletion PluginsDependencies) |
590 -DUSE_LEGACY_BOOST=${USE_LEGACY_BOOST} | 737 |
591 ${ConnectivityChecksFlags} | 738 set_target_properties( |
592 | 739 DelayedDeletion PROPERTIES |
593 -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | 740 VERSION ${ORTHANC_VERSION} |
594 -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} | 741 SOVERSION ${ORTHANC_VERSION} |
595 -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | 742 ) |
596 -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} | 743 |
597 -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} | 744 install( |
598 -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} | 745 TARGETS DelayedDeletion |
599 ) | 746 RUNTIME DESTINATION lib # Destination for Windows |
600 | 747 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux |
601 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | 748 ) |
602 if (MSVC) | |
603 set(Prefix "") | |
604 else() | |
605 set(Prefix "lib") # MinGW | |
606 endif() | |
607 | |
608 install(FILES | |
609 ${CMAKE_CURRENT_BINARY_DIR}/${Prefix}ConnectivityChecks.dll | |
610 DESTINATION "lib") | |
611 else() | |
612 list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix) | |
613 list(GET CMAKE_FIND_LIBRARY_SUFFIXES 0 Suffix) | |
614 install(FILES | |
615 ${CMAKE_CURRENT_BINARY_DIR}/${Prefix}ConnectivityChecks${Suffix} | |
616 ${CMAKE_CURRENT_BINARY_DIR}/${Prefix}ConnectivityChecks${Suffix}.${ORTHANC_VERSION} | |
617 DESTINATION "share/orthanc/plugins") | |
618 endif() | |
619 endif() | |
620 | |
621 | |
622 ##################################################################### | |
623 ## Build the "DelayedDeletion" plugin | |
624 ##################################################################### | |
625 | |
626 if (ENABLE_PLUGINS AND BUILD_DELAYED_DELETION) | |
627 | |
628 set(DelayedDeletionFlags) | |
629 | |
630 if (CMAKE_TOOLCHAIN_FILE) | |
631 # Take absolute path to the toolchain | |
632 get_filename_component(TMP ${CMAKE_TOOLCHAIN_FILE} REALPATH BASE ${CMAKE_SOURCE_DIR}) | |
633 list(APPEND DelayedDeletionFlags -DCMAKE_TOOLCHAIN_FILE=${TMP}) | |
634 endif() | |
635 | |
636 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") | |
637 list(APPEND DelayedDeletionFlags | |
638 -DLSB_CC=${CMAKE_LSB_CC} | |
639 -DLSB_CXX=${CMAKE_LSB_CXX} | |
640 ) | |
641 endif() | |
642 | |
643 externalproject_add(DelayedDeletion | |
644 SOURCE_DIR "${CMAKE_SOURCE_DIR}/Plugins/Samples/DelayedDeletion" | |
645 | |
646 # We explicitly provide a build directory, in order to avoid paths | |
647 # that are too long on our Visual Studio 2008 CIS | |
648 BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/DelayedDeletion-build" | |
649 | |
650 # this helps triggering build when changing the external project | |
651 BUILD_ALWAYS 1 | |
652 | |
653 CMAKE_ARGS | |
654 -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} | |
655 -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR} | |
656 -DPLUGIN_VERSION=${ORTHANC_VERSION} | |
657 -DSTATIC_BUILD=${STATIC_BUILD} | |
658 -DALLOW_DOWNLOADS=${ALLOW_DOWNLOADS} | |
659 -DUSE_SYSTEM_BOOST=${USE_SYSTEM_BOOST} | |
660 -DUSE_LEGACY_JSONCPP=${USE_LEGACY_JSONCPP} | |
661 -DUSE_LEGACY_BOOST=${USE_LEGACY_BOOST} | |
662 ${DelayedDeletionFlags} | |
663 | |
664 -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | |
665 -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} | |
666 -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | |
667 -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} | |
668 -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} | |
669 -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} | |
670 ) | |
671 | |
672 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
673 if (MSVC) | |
674 set(Prefix "") | |
675 else() | |
676 set(Prefix "lib") # MinGW | |
677 endif() | |
678 | |
679 install(FILES | |
680 ${CMAKE_CURRENT_BINARY_DIR}/${Prefix}DelayedDeletion.dll | |
681 DESTINATION "lib") | |
682 else() | |
683 list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix) | |
684 list(GET CMAKE_FIND_LIBRARY_SUFFIXES 0 Suffix) | |
685 install(FILES | |
686 ${CMAKE_CURRENT_BINARY_DIR}/${Prefix}DelayedDeletion${Suffix} | |
687 ${CMAKE_CURRENT_BINARY_DIR}/${Prefix}DelayedDeletion${Suffix}.${ORTHANC_VERSION} | |
688 DESTINATION "share/orthanc/plugins") | |
689 endif() | |
690 endif() | 749 endif() |
691 | 750 |
692 | 751 |
693 ##################################################################### | 752 ##################################################################### |
694 ## Build the "Housekeeper" plugin | 753 ## Build the "Housekeeper" plugin |
709 endif() | 768 endif() |
710 | 769 |
711 list(APPEND HOUSEKEEPER_RESOURCES ${AUTOGENERATED_DIR}/Housekeeper.rc) | 770 list(APPEND HOUSEKEEPER_RESOURCES ${AUTOGENERATED_DIR}/Housekeeper.rc) |
712 endif() | 771 endif() |
713 | 772 |
773 set_source_files_properties( | |
774 ${CMAKE_SOURCE_DIR}/Plugins/Samples/Housekeeper/Plugin.cpp | |
775 PROPERTIES COMPILE_DEFINITIONS "HOUSEKEEPER_VERSION=\"${ORTHANC_VERSION}\"" | |
776 ) | |
777 | |
714 add_library(Housekeeper SHARED | 778 add_library(Housekeeper SHARED |
715 ${CMAKE_SOURCE_DIR}/Plugins/Samples/Housekeeper/Plugin.cpp | 779 ${CMAKE_SOURCE_DIR}/Plugins/Samples/Housekeeper/Plugin.cpp |
716 ${HOUSEKEEPER_RESOURCES} | 780 ${HOUSEKEEPER_RESOURCES} |
717 ) | 781 ) |
718 | 782 |
719 target_link_libraries(Housekeeper | 783 DefineSourceBasenameForTarget(Housekeeper) |
720 ThirdPartyPlugins | 784 |
721 ) | 785 target_link_libraries(Housekeeper PluginsDependencies) |
722 | 786 |
723 set_target_properties( | 787 set_target_properties( |
724 Housekeeper PROPERTIES | 788 Housekeeper PROPERTIES |
725 VERSION ${ORTHANC_VERSION} | 789 VERSION ${ORTHANC_VERSION} |
726 SOVERSION ${ORTHANC_VERSION} | 790 SOVERSION ${ORTHANC_VERSION} |
737 ##################################################################### | 801 ##################################################################### |
738 ## Build the "AdvancedStorage" plugin | 802 ## Build the "AdvancedStorage" plugin |
739 ##################################################################### | 803 ##################################################################### |
740 | 804 |
741 if (ENABLE_PLUGINS AND BUILD_ADVANCED_STORAGE) | 805 if (ENABLE_PLUGINS AND BUILD_ADVANCED_STORAGE) |
742 | 806 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
743 set(AdvancedStorageFlags) | 807 execute_process( |
744 | 808 COMMAND |
745 if (CMAKE_TOOLCHAIN_FILE) | 809 ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/WindowsResources.py |
746 # Take absolute path to the toolchain | 810 ${ORTHANC_VERSION} AdvancedStorage AdvancedStorage.dll "Orthanc plugin to provide advanced file storage" |
747 get_filename_component(TMP ${CMAKE_TOOLCHAIN_FILE} REALPATH BASE ${CMAKE_SOURCE_DIR}) | 811 ERROR_VARIABLE Failure |
748 list(APPEND AdvancedStorageFlags -DCMAKE_TOOLCHAIN_FILE=${TMP}) | 812 OUTPUT_FILE ${AUTOGENERATED_DIR}/AdvancedStorage.rc |
813 ) | |
814 | |
815 if (Failure) | |
816 message(FATAL_ERROR "Error while computing the version information: ${Failure}") | |
817 endif() | |
818 | |
819 list(APPEND ADVANCED_STORAGE_RESOURCES ${AUTOGENERATED_DIR}/AdvancedStorage.rc) | |
749 endif() | 820 endif() |
750 | 821 |
751 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") | 822 set_source_files_properties( |
752 list(APPEND AdvancedStorageFlags | 823 ${CMAKE_SOURCE_DIR}/Plugins/Samples/AdvancedStorage/Plugin.cpp |
753 -DLSB_CC=${CMAKE_LSB_CC} | 824 PROPERTIES COMPILE_DEFINITIONS "ADVANCED_STORAGE_VERSION=\"${ORTHANC_VERSION}\"" |
754 -DLSB_CXX=${CMAKE_LSB_CXX} | 825 ) |
826 | |
827 add_library(AdvancedStorage SHARED | |
828 ${CMAKE_SOURCE_DIR}/Plugins/Samples/AdvancedStorage/Plugin.cpp | |
829 ${ORTHANC} | |
830 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/OrthancException.cpp | |
831 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SystemToolbox.cpp | |
832 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Toolbox.cpp | |
833 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Logging.cpp | |
834 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/ChunkedBuffer.cpp | |
835 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Enumerations.cpp | |
836 ) | |
837 | |
838 DefineSourceBasenameForTarget(AdvancedStorage) | |
839 | |
840 target_link_libraries(AdvancedStorage PluginsDependencies) | |
841 | |
842 set_target_properties( | |
843 AdvancedStorage PROPERTIES | |
844 VERSION ${ORTHANC_VERSION} | |
845 SOVERSION ${ORTHANC_VERSION} | |
846 ) | |
847 | |
848 install( | |
849 TARGETS AdvancedStorage | |
850 RUNTIME DESTINATION lib # Destination for Windows | |
851 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | |
852 ) | |
853 endif() | |
854 | |
855 ##################################################################### | |
856 ## Build the "MultitenantDicom" plugin | |
857 ##################################################################### | |
858 | |
859 if (ENABLE_PLUGINS AND BUILD_MULTITENANT_DICOM) | |
860 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
861 execute_process( | |
862 COMMAND | |
863 ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/WindowsResources.py | |
864 ${ORTHANC_VERSION} MultitenantDicom MultitenantDicom.dll "Orthanc plugin to provide a multitenant DICOM server" | |
865 ERROR_VARIABLE Failure | |
866 OUTPUT_FILE ${AUTOGENERATED_DIR}/MultitenantDicom.rc | |
755 ) | 867 ) |
868 | |
869 if (Failure) | |
870 message(FATAL_ERROR "Error while computing the version information: ${Failure}") | |
871 endif() | |
872 | |
873 list(APPEND MULTITENANT_DICOM_RESOURCES ${AUTOGENERATED_DIR}/MultitenantDicom.rc) | |
756 endif() | 874 endif() |
757 | 875 |
758 externalproject_add(AdvancedStorage | 876 EmbedResources( |
759 SOURCE_DIR "${CMAKE_SOURCE_DIR}/Plugins/Samples/AdvancedStorage" | 877 --target=MultitenantDicomResources |
760 | 878 --namespace=Orthanc.FrameworkResources |
761 # We explicitly provide a build directory, in order to avoid paths | 879 --framework-path=${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources |
762 # that are too long on our Visual Studio 2008 CIS | 880 ${LIBICU_RESOURCES} |
763 BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/AdvancedStorage-build" | 881 ${DCMTK_DICTIONARIES} |
764 | 882 ) |
765 # this helps triggering build when changing the external project | 883 |
766 BUILD_ALWAYS 1 | 884 set_source_files_properties( |
767 | 885 ${CMAKE_SOURCE_DIR}/Plugins/Samples/MultitenantDicom/Plugin.cpp |
768 CMAKE_ARGS | 886 PROPERTIES COMPILE_DEFINITIONS "ORTHANC_PLUGIN_VERSION=\"${ORTHANC_VERSION}\"" |
769 -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} | 887 ) |
770 -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR} | 888 |
771 -DPLUGIN_VERSION=${ORTHANC_VERSION} | 889 # The "OrthancFrameworkDependencies.cpp" file is used to bypass the |
772 -DSTATIC_BUILD=${STATIC_BUILD} | 890 # precompiled headers if compiling with Visual Studio |
773 -DALLOW_DOWNLOADS=${ALLOW_DOWNLOADS} | 891 add_library(MultitenantDicom SHARED |
774 -DUSE_SYSTEM_BOOST=${USE_SYSTEM_BOOST} | 892 ${CMAKE_SOURCE_DIR}/Plugins/Samples/MultitenantDicom/DicomFilter.cpp |
775 -DUSE_LEGACY_JSONCPP=${USE_LEGACY_JSONCPP} | 893 ${CMAKE_SOURCE_DIR}/Plugins/Samples/MultitenantDicom/FindRequestHandler.cpp |
776 -DUSE_LEGACY_BOOST=${USE_LEGACY_BOOST} | 894 ${CMAKE_SOURCE_DIR}/Plugins/Samples/MultitenantDicom/MoveRequestHandler.cpp |
777 ${AdvancedStorageFlags} | 895 ${CMAKE_SOURCE_DIR}/Plugins/Samples/MultitenantDicom/MultitenantDicomServer.cpp |
778 | 896 ${CMAKE_SOURCE_DIR}/Plugins/Samples/MultitenantDicom/Plugin.cpp |
779 -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | 897 ${CMAKE_SOURCE_DIR}/Plugins/Samples/MultitenantDicom/PluginToolbox.cpp |
780 -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} | 898 ${CMAKE_SOURCE_DIR}/Plugins/Samples/MultitenantDicom/StoreRequestHandler.cpp |
781 -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | 899 |
782 -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} | 900 ${CMAKE_SOURCE_DIR}/Plugins/Samples/MultitenantDicom/OrthancFrameworkDependencies.cpp |
783 -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} | 901 ${AUTOGENERATED_DIR}/MultitenantDicomResources.cpp |
784 -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} | 902 ${MULTITENANT_DICOM_RESOURCES} |
785 ) | 903 ) |
786 | 904 |
787 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | 905 DefineSourceBasenameForTarget(MultitenantDicom) |
788 if (MSVC) | 906 |
789 set(Prefix "") | 907 target_link_libraries(MultitenantDicom PluginsDependencies ${DCMTK_LIBRARIES}) |
790 else() | 908 |
791 set(Prefix "lib") # MinGW | 909 set_target_properties( |
792 endif() | 910 MultitenantDicom PROPERTIES |
793 | 911 VERSION ${ORTHANC_VERSION} |
794 install(FILES | 912 SOVERSION ${ORTHANC_VERSION} |
795 ${CMAKE_CURRENT_BINARY_DIR}/${Prefix}AdvancedStorage.dll | 913 ) |
796 DESTINATION "lib") | 914 |
797 else() | 915 install( |
798 list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix) | 916 TARGETS MultitenantDicom |
799 list(GET CMAKE_FIND_LIBRARY_SUFFIXES 0 Suffix) | 917 RUNTIME DESTINATION lib # Destination for Windows |
800 install(FILES | 918 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux |
801 ${CMAKE_CURRENT_BINARY_DIR}/${Prefix}AdvancedStorage${Suffix} | 919 ) |
802 ${CMAKE_CURRENT_BINARY_DIR}/${Prefix}AdvancedStorage${Suffix}.${ORTHANC_VERSION} | |
803 DESTINATION "share/orthanc/plugins") | |
804 endif() | |
805 endif() | 920 endif() |
806 | 921 |
807 | 922 |
808 ##################################################################### | 923 ##################################################################### |
809 ## Build the companion tool to recover files compressed using Orthanc | 924 ## Build the companion tool to recover files compressed using Orthanc |
832 ${AUTOGENERATED_DIR}/OrthancRecoverCompressedFile.rc | 947 ${AUTOGENERATED_DIR}/OrthancRecoverCompressedFile.rc |
833 ) | 948 ) |
834 endif() | 949 endif() |
835 | 950 |
836 add_executable(OrthancRecoverCompressedFile ${RECOVER_COMPRESSED_SOURCES}) | 951 add_executable(OrthancRecoverCompressedFile ${RECOVER_COMPRESSED_SOURCES}) |
952 DefineSourceBasenameForTarget(OrthancRecoverCompressedFile) | |
837 | 953 |
838 target_link_libraries(OrthancRecoverCompressedFile CoreLibrary) | 954 target_link_libraries(OrthancRecoverCompressedFile CoreLibrary) |
839 | 955 |
840 install( | 956 install( |
841 TARGETS OrthancRecoverCompressedFile | 957 TARGETS OrthancRecoverCompressedFile |
888 ##################################################################### | 1004 ##################################################################### |
889 | 1005 |
890 if (ENABLE_PLUGINS) | 1006 if (ENABLE_PLUGINS) |
891 install( | 1007 install( |
892 FILES | 1008 FILES |
893 ${CMAKE_SOURCE_DIR}/Plugins/Include/orthanc/OrthancCPlugin.h | 1009 ${CMAKE_SOURCE_DIR}/Plugins/Include/orthanc/OrthancCPlugin.h |
894 ${CMAKE_SOURCE_DIR}/Plugins/Include/orthanc/OrthancCDatabasePlugin.h | 1010 ${CMAKE_SOURCE_DIR}/Plugins/Include/orthanc/OrthancCDatabasePlugin.h |
1011 ${CMAKE_SOURCE_DIR}/Plugins/Include/orthanc/OrthancDatabasePlugin.proto | |
895 DESTINATION include/orthanc | 1012 DESTINATION include/orthanc |
896 ) | 1013 ) |
897 endif() | 1014 endif() |
898 | 1015 |
899 | 1016 |