comparison CMakeLists.txt @ 24:065bc476bcdc

use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 06 Jul 2020 16:23:48 +0200
parents ec8b0f8df766
children a0af5a8182a8
comparison
equal deleted inserted replaced
23:ec8b0f8df766 24:065bc476bcdc
41 # Advanced parameters to fine-tune linking against system libraries 41 # Advanced parameters to fine-tune linking against system libraries
42 set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK") 42 set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK")
43 43
44 44
45 # Download and setup the Orthanc framework 45 # Download and setup the Orthanc framework
46 include(${CMAKE_CURRENT_LIST_DIR}/Resources/Orthanc/DownloadOrthancFramework.cmake) 46 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake)
47 include(${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake)
48 47
49 set(HAS_EMBEDDED_RESOURCES ON) 48 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system")
50 set(ENABLE_LOCALE OFF) # Disable support for locales (notably in Boost) 49 link_libraries(${ORTHANC_FRAMEWORK_LIBRARIES})
51 set(ENABLE_GOOGLE_TEST ON)
52 set(ENABLE_MODULE_IMAGES OFF)
53 set(ENABLE_MODULE_JOBS OFF)
54 set(ENABLE_MODULE_DICOM OFF)
55 set(ENABLE_ZLIB ON)
56 50
57 include(${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake) 51 set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test")
58 include_directories( 52 set(USE_GOOGLE_TEST_DEBIAN_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)")
59 ${ORTHANC_FRAMEWORK_ROOT}/Sources 53 mark_as_advanced(USE_GOOGLE_TEST_DEBIAN_PACKAGE)
60 ) 54 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/CMake/GoogleTestConfiguration.cmake)
55
56 else()
57 include(${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake)
58
59 set(ENABLE_LOCALE OFF) # Disable support for locales (notably in Boost)
60 set(ENABLE_GOOGLE_TEST ON)
61 set(ENABLE_MODULE_IMAGES OFF)
62 set(ENABLE_MODULE_JOBS OFF)
63 set(ENABLE_MODULE_DICOM OFF)
64 set(ENABLE_ZLIB ON)
65
66 include(${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake)
67 include_directories(
68 ${ORTHANC_FRAMEWORK_ROOT}/Sources
69 )
70 endif()
71
72
73 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake)
61 74
62 75
63 # Possibly patch the Orthanc framework 76 # Possibly patch the Orthanc framework
64 if (DEFINED ORTHANC_FRAMEWORK_PATCH AND 77 if (DEFINED ORTHANC_FRAMEWORK_PATCH AND
65 NOT EXISTS "${ORTHANC_FRAMEWORK_ROOT}/patched") 78 NOT EXISTS "${ORTHANC_FRAMEWORK_ROOT}/patched")
76 89
77 90
78 # Check that the Orthanc SDK headers are available 91 # Check that the Orthanc SDK headers are available
79 if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK) 92 if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK)
80 if (ORTHANC_SDK_VERSION STREQUAL "1.4.2") 93 if (ORTHANC_SDK_VERSION STREQUAL "1.4.2")
81 include_directories(${CMAKE_CURRENT_LIST_DIR}/Resources/Orthanc/Sdk-1.4.2) 94 include_directories(${CMAKE_SOURCE_DIR}/Resources/Orthanc/Sdk-1.4.2)
82 else() 95 else()
83 message(FATAL_ERROR "Unsupported version of the Orthanc plugin SDK: ${ORTHANC_SDK_VERSION}") 96 message(FATAL_ERROR "Unsupported version of the Orthanc plugin SDK: ${ORTHANC_SDK_VERSION}")
84 endif() 97 endif()
85 else () 98 else ()
86 CHECK_INCLUDE_FILE_CXX(orthanc/OrthancCDatabasePlugin.h HAVE_ORTHANC_H) 99 CHECK_INCLUDE_FILE_CXX(orthanc/OrthancCDatabasePlugin.h HAVE_ORTHANC_H)