Mercurial > hg > orthanc
comparison OrthancServer/CMakeLists.txt @ 5257:0b183bb77c83
Avoid the use of "externalproject_add()" to build the sample plugins
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 12 Apr 2023 11:54:08 +0200 |
parents | e7529e6241d2 |
children | afe92108f463 0d1704d8cc65 |
comparison
equal
deleted
inserted
replaced
5252:742448a9b600 | 5257:0b183bb77c83 |
---|---|
323 | 323 |
324 | 324 |
325 add_definitions( | 325 add_definitions( |
326 -DORTHANC_BUILD_UNIT_TESTS=1 | 326 -DORTHANC_BUILD_UNIT_TESTS=1 |
327 -DORTHANC_BUILDING_SERVER_LIBRARY=1 | 327 -DORTHANC_BUILDING_SERVER_LIBRARY=1 |
328 | 328 |
329 # Macros for the plugins | 329 # Macros for the plugins |
330 -DHAS_ORTHANC_EXCEPTION=0 | 330 -DHAS_ORTHANC_EXCEPTION=0 |
331 -DMODALITY_WORKLISTS_VERSION="${ORTHANC_VERSION}" | |
332 -DSERVE_FOLDERS_VERSION="${ORTHANC_VERSION}" | |
333 -DHOUSEKEEPER_VERSION="${ORTHANC_VERSION}" | |
334 ) | 331 ) |
335 | 332 |
336 | 333 |
337 # Setup precompiled headers for Microsoft Visual Studio | 334 # Setup precompiled headers for Microsoft Visual Studio |
338 | 335 |
472 ##################################################################### | 469 ##################################################################### |
473 ## Build a static library to share code between the plugins | 470 ## Build a static library to share code between the plugins |
474 ##################################################################### | 471 ##################################################################### |
475 | 472 |
476 if (ENABLE_PLUGINS AND | 473 if (ENABLE_PLUGINS AND |
477 (BUILD_SERVE_FOLDERS OR BUILD_MODALITY_WORKLISTS OR BUILD_HOUSEKEEPER)) | 474 (BUILD_SERVE_FOLDERS OR BUILD_MODALITY_WORKLISTS OR BUILD_HOUSEKEEPER OR |
478 add_library(ThirdPartyPlugins STATIC | 475 BUILD_DELAYED_DELETION)) |
476 set(PLUGINS_FRAMEWORK_SOURCES | |
479 ${BOOST_SOURCES} | 477 ${BOOST_SOURCES} |
480 ${JSONCPP_SOURCES} | 478 ${JSONCPP_SOURCES} |
481 ${LIBICONV_SOURCES} | 479 ${LIBICONV_SOURCES} |
482 ${LIBICU_SOURCES} | 480 ${LIBICU_SOURCES} |
483 Plugins/Samples/Common/OrthancPluginCppWrapper.cpp | 481 Plugins/Samples/Common/OrthancPluginCppWrapper.cpp |
484 ) | 482 ) |
485 | 483 |
486 if (LIBICU_LIBRARIES) | 484 if (BUILD_DELAYED_DELETION) |
487 target_link_libraries(ThirdPartyPlugins ${LIBICU_LIBRARIES}) | 485 list(APPEND PLUGINS_FRAMEWORK_SOURCES |
486 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/ThirdParty/base64/base64.cpp | |
487 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/ThirdParty/md5/md5.c | |
488 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/ChunkedBuffer.cpp | |
489 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/DeflateBaseCompressor.cpp | |
490 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/GzipCompressor.cpp | |
491 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/HierarchicalZipWriter.cpp | |
492 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/IBufferCompressor.cpp | |
493 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/ZipReader.cpp | |
494 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/ZipWriter.cpp | |
495 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Compression/ZlibCompressor.cpp | |
496 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/DicomFormat/DicomTag.cpp | |
497 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Enumerations.cpp | |
498 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/FileStorage/FilesystemStorage.cpp | |
499 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Logging.cpp | |
500 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/MultiThreading/SharedMessageQueue.cpp | |
501 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/OrthancException.cpp | |
502 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SQLite/Connection.cpp | |
503 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SQLite/FunctionContext.cpp | |
504 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SQLite/Statement.cpp | |
505 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SQLite/StatementId.cpp | |
506 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SQLite/StatementReference.cpp | |
507 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SQLite/Transaction.cpp | |
508 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/StringMemoryBuffer.cpp | |
509 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/SystemToolbox.cpp | |
510 ${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/Toolbox.cpp | |
511 ${DCMTK_SOURCES} | |
512 ${PUGIXML_SOURCES} | |
513 ${UUID_SOURCES} | |
514 ${ZLIB_SOURCES} | |
515 ${SQLITE_SOURCES} | |
516 ) | |
488 endif() | 517 endif() |
518 | |
519 add_library(PluginsFramework STATIC | |
520 ${PLUGINS_FRAMEWORK_SOURCES} | |
521 ) | |
522 | |
523 # Remove the dependency upon ICU in plugins, as this greatly | |
524 # increase the size of the resulting binaries, since they must | |
525 # embed the ICU dictionary. | |
526 set_target_properties( | |
527 PluginsFramework | |
528 PROPERTIES COMPILE_DEFINITIONS "ORTHANC_ENABLE_ICU=0" | |
529 ) | |
489 | 530 |
490 # Add the "-fPIC" option as this static library must be embedded | 531 # Add the "-fPIC" option as this static library must be embedded |
491 # inside shared libraries (important on UNIX) | 532 # inside shared libraries (important on UNIX) |
492 set_property( | 533 set_target_properties( |
493 TARGET ThirdPartyPlugins | 534 PluginsFramework |
494 PROPERTY POSITION_INDEPENDENT_CODE ON | 535 PROPERTIES POSITION_INDEPENDENT_CODE ON |
495 ) | 536 ) |
496 endif() | 537 endif() |
497 | 538 |
498 | 539 |
499 ##################################################################### | 540 ##################################################################### |
515 endif() | 556 endif() |
516 | 557 |
517 list(APPEND SERVE_FOLDERS_RESOURCES ${AUTOGENERATED_DIR}/ServeFolders.rc) | 558 list(APPEND SERVE_FOLDERS_RESOURCES ${AUTOGENERATED_DIR}/ServeFolders.rc) |
518 endif() | 559 endif() |
519 | 560 |
561 set_source_files_properties( | |
562 ${CMAKE_SOURCE_DIR}/Plugins/Samples/ServeFolders/Plugin.cpp | |
563 PROPERTIES COMPILE_DEFINITIONS "SERVE_FOLDERS_VERSION=\"${ORTHANC_VERSION}\"" | |
564 ) | |
565 | |
520 add_library(ServeFolders SHARED | 566 add_library(ServeFolders SHARED |
521 ${CMAKE_SOURCE_DIR}/Plugins/Samples/ServeFolders/Plugin.cpp | 567 ${CMAKE_SOURCE_DIR}/Plugins/Samples/ServeFolders/Plugin.cpp |
522 ${SERVE_FOLDERS_RESOURCES} | 568 ${SERVE_FOLDERS_RESOURCES} |
523 ) | 569 ) |
524 | 570 |
525 target_link_libraries(ServeFolders ThirdPartyPlugins) | 571 target_link_libraries(ServeFolders PluginsFramework) |
526 | 572 |
527 set_target_properties( | 573 set_target_properties( |
528 ServeFolders PROPERTIES | 574 ServeFolders PROPERTIES |
529 VERSION ${ORTHANC_VERSION} | 575 VERSION ${ORTHANC_VERSION} |
530 SOVERSION ${ORTHANC_VERSION} | 576 SOVERSION ${ORTHANC_VERSION} |
558 endif() | 604 endif() |
559 | 605 |
560 list(APPEND MODALITY_WORKLISTS_RESOURCES ${AUTOGENERATED_DIR}/ModalityWorklists.rc) | 606 list(APPEND MODALITY_WORKLISTS_RESOURCES ${AUTOGENERATED_DIR}/ModalityWorklists.rc) |
561 endif() | 607 endif() |
562 | 608 |
609 set_source_files_properties( | |
610 ${CMAKE_SOURCE_DIR}/Plugins/Samples/ModalityWorklists/Plugin.cpp | |
611 PROPERTIES COMPILE_DEFINITIONS "MODALITY_WORKLISTS_VERSION=\"${ORTHANC_VERSION}\"" | |
612 ) | |
613 | |
563 add_library(ModalityWorklists SHARED | 614 add_library(ModalityWorklists SHARED |
564 ${CMAKE_SOURCE_DIR}/Plugins/Samples/ModalityWorklists/Plugin.cpp | 615 ${CMAKE_SOURCE_DIR}/Plugins/Samples/ModalityWorklists/Plugin.cpp |
565 ${MODALITY_WORKLISTS_RESOURCES} | 616 ${MODALITY_WORKLISTS_RESOURCES} |
566 ) | 617 ) |
567 | 618 |
568 target_link_libraries(ModalityWorklists ThirdPartyPlugins) | 619 target_link_libraries(ModalityWorklists PluginsFramework) |
569 | 620 |
570 set_target_properties( | 621 set_target_properties( |
571 ModalityWorklists PROPERTIES | 622 ModalityWorklists PROPERTIES |
572 VERSION ${ORTHANC_VERSION} | 623 VERSION ${ORTHANC_VERSION} |
573 SOVERSION ${ORTHANC_VERSION} | 624 SOVERSION ${ORTHANC_VERSION} |
579 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | 630 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux |
580 ) | 631 ) |
581 endif() | 632 endif() |
582 | 633 |
583 | 634 |
584 if (ENABLE_PLUGINS AND (BUILD_DELAYED_DELETION OR BUILD_CONNECTIVITY_CHECKS)) | |
585 include(ExternalProject) | |
586 endif() | |
587 | |
588 | 635 |
589 ##################################################################### | 636 ##################################################################### |
590 ## Build the "ConnectivityChecks" plugin | 637 ## Build the "ConnectivityChecks" plugin |
591 ##################################################################### | 638 ##################################################################### |
592 | 639 |
593 if (ENABLE_PLUGINS AND BUILD_CONNECTIVITY_CHECKS) | 640 if (ENABLE_PLUGINS AND BUILD_CONNECTIVITY_CHECKS) |
594 | 641 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
595 set(ConnectivityChecksFlags) | 642 execute_process( |
596 | 643 COMMAND |
597 if (CMAKE_TOOLCHAIN_FILE) | 644 ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/WindowsResources.py |
598 # Take absolute path to the toolchain | 645 ${ORTHANC_VERSION} ConnectivityChecks ConnectivityChecks.dll "Orthanc plugin to show connectivity status" |
599 get_filename_component(TMP ${CMAKE_TOOLCHAIN_FILE} REALPATH BASE ${CMAKE_SOURCE_DIR}) | 646 ERROR_VARIABLE Failure |
600 list(APPEND ConnectivityChecksFlags -DCMAKE_TOOLCHAIN_FILE=${TMP}) | 647 OUTPUT_FILE ${AUTOGENERATED_DIR}/ConnectivityChecks.rc |
648 ) | |
649 | |
650 if (Failure) | |
651 message(FATAL_ERROR "Error while computing the version information: ${Failure}") | |
652 endif() | |
653 | |
654 list(APPEND CONNECTIVITY_CHECKS_RESOURCES ${AUTOGENERATED_DIR}/ConnectivityChecks.rc) | |
601 endif() | 655 endif() |
602 | 656 |
603 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") | 657 include(${CMAKE_SOURCE_DIR}/Plugins/Samples/ConnectivityChecks/JavaScriptLibraries.cmake) |
604 list(APPEND ConnectivityChecksFlags | 658 |
605 -DLSB_CC=${CMAKE_LSB_CC} | 659 EmbedResources( |
606 -DLSB_CXX=${CMAKE_LSB_CXX} | 660 --target=ConnectivityChecksResources |
661 --framework-path=${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources | |
662 WEB_RESOURCES ${CMAKE_SOURCE_DIR}/Plugins/Samples/ConnectivityChecks/WebResources | |
663 LIBRARIES ${CONNECTIVITY_CHECKS_JAVASCRIPT_DIR} | |
664 ) | |
665 | |
666 set_source_files_properties( | |
667 ${CMAKE_SOURCE_DIR}/Plugins/Samples/ConnectivityChecks/Plugin.cpp | |
668 PROPERTIES COMPILE_DEFINITIONS "ORTHANC_PLUGIN_NAME=\"connectivity-checks\";ORTHANC_PLUGIN_VERSION=\"${ORTHANC_VERSION}\"" | |
669 ) | |
670 | |
671 add_library(ConnectivityChecks SHARED | |
672 ${AUTOGENERATED_DIR}/ConnectivityChecksResources.cpp | |
673 ${CMAKE_SOURCE_DIR}/Plugins/Samples/ConnectivityChecks/Plugin.cpp | |
674 ${CONNECTIVITY_CHECKS_RESOURCES} | |
675 ) | |
676 | |
677 target_link_libraries(ConnectivityChecks PluginsFramework) | |
678 | |
679 set_target_properties( | |
680 ConnectivityChecks PROPERTIES | |
681 VERSION ${ORTHANC_VERSION} | |
682 SOVERSION ${ORTHANC_VERSION} | |
683 ) | |
684 | |
685 install( | |
686 TARGETS ConnectivityChecks | |
687 RUNTIME DESTINATION lib # Destination for Windows | |
688 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | |
689 ) | |
690 endif() | |
691 | |
692 | |
693 ##################################################################### | |
694 ## Build the "DelayedDeletion" plugin | |
695 ##################################################################### | |
696 | |
697 if (ENABLE_PLUGINS AND BUILD_DELAYED_DELETION) | |
698 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
699 execute_process( | |
700 COMMAND | |
701 ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/WindowsResources.py | |
702 ${ORTHANC_VERSION} DelayedDeletion DelayedDeletion.dll "Orthanc plugin to delay deletion of files" | |
703 ERROR_VARIABLE Failure | |
704 OUTPUT_FILE ${AUTOGENERATED_DIR}/DelayedDeletion.rc | |
607 ) | 705 ) |
706 | |
707 if (Failure) | |
708 message(FATAL_ERROR "Error while computing the version information: ${Failure}") | |
709 endif() | |
710 | |
711 list(APPEND DELAYED_DELETION_RESOURCES ${AUTOGENERATED_DIR}/DelayedDeletion.rc) | |
608 endif() | 712 endif() |
609 | 713 |
610 externalproject_add(ConnectivityChecks | 714 set_source_files_properties( |
611 SOURCE_DIR "${CMAKE_SOURCE_DIR}/Plugins/Samples/ConnectivityChecks" | 715 ${CMAKE_SOURCE_DIR}/Plugins/Samples/DelayedDeletion/Plugin.cpp |
612 | 716 PROPERTIES COMPILE_DEFINITIONS "ORTHANC_PLUGIN_NAME=\"delayed-deletion\";ORTHANC_PLUGIN_VERSION=\"${ORTHANC_VERSION}\"" |
613 # We explicitly provide a build directory, in order to avoid paths | 717 ) |
614 # that are too long on our Visual Studio 2008 CIS | 718 |
615 BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/ConnectivityChecks-build" | 719 add_library(DelayedDeletion SHARED |
616 | 720 ${CMAKE_SOURCE_DIR}/Plugins/Engine/PluginsEnumerations.cpp |
617 # this helps triggering build when changing the external project | 721 ${CMAKE_SOURCE_DIR}/Plugins/Samples/DelayedDeletion/PendingDeletionsDatabase.cpp |
618 BUILD_ALWAYS 1 | 722 ${CMAKE_SOURCE_DIR}/Plugins/Samples/DelayedDeletion/Plugin.cpp |
619 | 723 ${DELAYED_DELETION_RESOURCES} |
620 CMAKE_ARGS | 724 ) |
621 -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} | 725 |
622 -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR} | 726 target_link_libraries(DelayedDeletion PluginsFramework ${DCMTK_LIBRARIES}) |
623 -DPLUGIN_VERSION=${ORTHANC_VERSION} | 727 |
624 -DSTATIC_BUILD=${STATIC_BUILD} | 728 set_target_properties( |
625 -DALLOW_DOWNLOADS=${ALLOW_DOWNLOADS} | 729 DelayedDeletion PROPERTIES |
626 -DUSE_SYSTEM_BOOST=${USE_SYSTEM_BOOST} | 730 VERSION ${ORTHANC_VERSION} |
627 -DUSE_LEGACY_JSONCPP=${USE_LEGACY_JSONCPP} | 731 SOVERSION ${ORTHANC_VERSION} |
628 -DUSE_LEGACY_BOOST=${USE_LEGACY_BOOST} | 732 ) |
629 ${ConnectivityChecksFlags} | 733 |
630 | 734 install( |
631 -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | 735 TARGETS DelayedDeletion |
632 -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} | 736 RUNTIME DESTINATION lib # Destination for Windows |
633 -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | 737 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux |
634 -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} | 738 ) |
635 -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} | |
636 -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} | |
637 | |
638 INSTALL_COMMAND "" | |
639 ) | |
640 | |
641 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
642 if (MSVC) | |
643 set(Prefix "") | |
644 else() | |
645 set(Prefix "lib") # MinGW | |
646 endif() | |
647 | |
648 install(FILES | |
649 ${CMAKE_CURRENT_BINARY_DIR}/${Prefix}ConnectivityChecks.dll | |
650 DESTINATION "lib") | |
651 else() | |
652 list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix) | |
653 list(GET CMAKE_FIND_LIBRARY_SUFFIXES 0 Suffix) | |
654 install(FILES | |
655 ${CMAKE_CURRENT_BINARY_DIR}/ConnectivityChecks-build/${Prefix}ConnectivityChecks${Suffix} | |
656 ${CMAKE_CURRENT_BINARY_DIR}/ConnectivityChecks-build/${Prefix}ConnectivityChecks${Suffix}.${ORTHANC_VERSION} | |
657 DESTINATION "share/orthanc/plugins") | |
658 endif() | |
659 endif() | |
660 | |
661 | |
662 ##################################################################### | |
663 ## Build the "DelayedDeletion" plugin | |
664 ##################################################################### | |
665 | |
666 if (ENABLE_PLUGINS AND BUILD_DELAYED_DELETION) | |
667 | |
668 set(DelayedDeletionFlags) | |
669 | |
670 if (CMAKE_TOOLCHAIN_FILE) | |
671 # Take absolute path to the toolchain | |
672 get_filename_component(TMP ${CMAKE_TOOLCHAIN_FILE} REALPATH BASE ${CMAKE_SOURCE_DIR}) | |
673 list(APPEND DelayedDeletionFlags -DCMAKE_TOOLCHAIN_FILE=${TMP}) | |
674 endif() | |
675 | |
676 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") | |
677 list(APPEND DelayedDeletionFlags | |
678 -DLSB_CC=${CMAKE_LSB_CC} | |
679 -DLSB_CXX=${CMAKE_LSB_CXX} | |
680 ) | |
681 endif() | |
682 | |
683 externalproject_add(DelayedDeletion | |
684 SOURCE_DIR "${CMAKE_SOURCE_DIR}/Plugins/Samples/DelayedDeletion" | |
685 | |
686 # We explicitly provide a build directory, in order to avoid paths | |
687 # that are too long on our Visual Studio 2008 CIS | |
688 BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/DelayedDeletion-build" | |
689 | |
690 # this helps triggering build when changing the external project | |
691 BUILD_ALWAYS 1 | |
692 | |
693 CMAKE_ARGS | |
694 -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} | |
695 -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR} | |
696 -DPLUGIN_VERSION=${ORTHANC_VERSION} | |
697 -DSTATIC_BUILD=${STATIC_BUILD} | |
698 -DALLOW_DOWNLOADS=${ALLOW_DOWNLOADS} | |
699 -DUSE_SYSTEM_BOOST=${USE_SYSTEM_BOOST} | |
700 -DUSE_LEGACY_JSONCPP=${USE_LEGACY_JSONCPP} | |
701 -DUSE_LEGACY_BOOST=${USE_LEGACY_BOOST} | |
702 ${DelayedDeletionFlags} | |
703 | |
704 -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | |
705 -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} | |
706 -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | |
707 -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} | |
708 -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} | |
709 -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} | |
710 | |
711 INSTALL_COMMAND "" | |
712 ) | |
713 | |
714 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
715 if (MSVC) | |
716 set(Prefix "") | |
717 else() | |
718 set(Prefix "lib") # MinGW | |
719 endif() | |
720 | |
721 install(FILES | |
722 ${CMAKE_CURRENT_BINARY_DIR}/${Prefix}DelayedDeletion.dll | |
723 DESTINATION "lib") | |
724 else() | |
725 list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix) | |
726 list(GET CMAKE_FIND_LIBRARY_SUFFIXES 0 Suffix) | |
727 install(FILES | |
728 ${CMAKE_CURRENT_BINARY_DIR}/DelayedDeletion-build/${Prefix}DelayedDeletion${Suffix} | |
729 ${CMAKE_CURRENT_BINARY_DIR}/DelayedDeletion-build/${Prefix}DelayedDeletion${Suffix}.${ORTHANC_VERSION} | |
730 DESTINATION "share/orthanc/plugins") | |
731 endif() | |
732 endif() | 739 endif() |
733 | 740 |
734 | 741 |
735 ##################################################################### | 742 ##################################################################### |
736 ## Build the "Housekeeper" plugin | 743 ## Build the "Housekeeper" plugin |
751 endif() | 758 endif() |
752 | 759 |
753 list(APPEND HOUSEKEEPER_RESOURCES ${AUTOGENERATED_DIR}/Housekeeper.rc) | 760 list(APPEND HOUSEKEEPER_RESOURCES ${AUTOGENERATED_DIR}/Housekeeper.rc) |
754 endif() | 761 endif() |
755 | 762 |
763 set_source_files_properties( | |
764 ${CMAKE_SOURCE_DIR}/Plugins/Samples/Housekeeper/Plugin.cpp | |
765 PROPERTIES COMPILE_DEFINITIONS "HOUSEKEEPER_VERSION=\"${ORTHANC_VERSION}\"" | |
766 ) | |
767 | |
756 add_library(Housekeeper SHARED | 768 add_library(Housekeeper SHARED |
757 ${CMAKE_SOURCE_DIR}/Plugins/Samples/Housekeeper/Plugin.cpp | 769 ${CMAKE_SOURCE_DIR}/Plugins/Samples/Housekeeper/Plugin.cpp |
758 ${HOUSEKEEPER_RESOURCES} | 770 ${HOUSEKEEPER_RESOURCES} |
759 ) | 771 ) |
760 | 772 |
761 target_link_libraries(Housekeeper | 773 target_link_libraries(Housekeeper |
762 ThirdPartyPlugins | 774 PluginsFramework |
763 ) | 775 ) |
764 | 776 |
765 set_target_properties( | 777 set_target_properties( |
766 Housekeeper PROPERTIES | 778 Housekeeper PROPERTIES |
767 VERSION ${ORTHANC_VERSION} | 779 VERSION ${ORTHANC_VERSION} |