comparison CMakeLists.txt @ 36:92b93845d84b

use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 06 Jul 2020 13:20:02 +0200
parents eb09eb1251b9
children 56c9b700a0db
comparison
equal deleted inserted replaced
35:2af772742d0b 36:92b93845d84b
24 set(USE_SYSTEM_GDCM ON CACHE BOOL "Use the system version of Grassroot DICOM (GDCM)") 24 set(USE_SYSTEM_GDCM ON CACHE BOOL "Use the system version of Grassroot DICOM (GDCM)")
25 set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK") 25 set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK")
26 set(ORTHANC_SDK_VERSION "1.0.0" CACHE STRING "Version of the Orthanc plugin SDK to use, if not using the system version (can be \"1.0.0\")") 26 set(ORTHANC_SDK_VERSION "1.0.0" CACHE STRING "Version of the Orthanc plugin SDK to use, if not using the system version (can be \"1.0.0\")")
27 27
28 28
29 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/DownloadOrthancFramework.cmake)
30 29
31 set(OPENSSL_STATIC_VERSION "1.0.2" CACHE STRING "TODO - Upgrade to OpenSSL 1.1.1" FORCE) 30 # Download and setup the Orthanc framework
31 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake)
32 32
33 include(${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) 33 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system")
34 link_libraries(${ORTHANC_FRAMEWORK_LIBRARIES})
34 35
35 set(ENABLE_CRYPTO_OPTIONS ON) 36 set(USE_SYSTEM_CURL ON CACHE BOOL "Use the system version of LibCurl")
36 set(ENABLE_ZLIB ON) 37 set(USE_SYSTEM_OPENSSL ON CACHE BOOL "Use the system version of OpenSSL")
37 set(ENABLE_WEB_CLIENT ON) 38
38 set(ENABLE_OPENSSL_ENGINES ON) # Necessary on Windows 39 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/CMake/LibCurlConfiguration.cmake)
40 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/CMake/OpenSslConfiguration.cmake)
39 41
40 include(${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake) 42 else()
43 set(OPENSSL_STATIC_VERSION "1.0.2" CACHE STRING "TODO - Upgrade to OpenSSL 1.1.1" FORCE)
44
45 include(${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake)
46
47 set(ENABLE_CRYPTO_OPTIONS ON)
48 set(ENABLE_ZLIB ON)
49 set(ENABLE_WEB_CLIENT ON)
50 set(ENABLE_OPENSSL_ENGINES ON) # Necessary on Windows
51
52 include(${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake)
53 include_directories(${ORTHANC_FRAMEWORK_ROOT}/Sources)
54 endif()
55
41 56
42 include(${CMAKE_SOURCE_DIR}/Resources/CMake/CRC32C.cmake) 57 include(${CMAKE_SOURCE_DIR}/Resources/CMake/CRC32C.cmake)
43 include(${CMAKE_SOURCE_DIR}/Resources/CMake/NlohmannJson.cmake) 58 include(${CMAKE_SOURCE_DIR}/Resources/CMake/NlohmannJson.cmake)
44 include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleCloudPlatform.cmake) 59 include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleCloudPlatform.cmake)
60 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake)
45 61
46 62
47 if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK) 63 if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK)
48 if (ORTHANC_SDK_VERSION STREQUAL "1.0.0") 64 if (ORTHANC_SDK_VERSION STREQUAL "1.0.0")
49 include_directories(${CMAKE_SOURCE_DIR}/Resources/Orthanc/Sdk-1.0.0) 65 include_directories(${CMAKE_SOURCE_DIR}/Resources/Orthanc/Sdk-1.0.0)
66 -DGCP_PLUGIN_VERSION="${GCP_PLUGIN_VERSION}" 82 -DGCP_PLUGIN_VERSION="${GCP_PLUGIN_VERSION}"
67 ) 83 )
68 84
69 include_directories( 85 include_directories(
70 ${AUTOGENERATED_DIR} 86 ${AUTOGENERATED_DIR}
71 ${ORTHANC_FRAMEWORK_ROOT}/Sources/
72 ) 87 )
73 88
74 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") 89 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
75 execute_process( 90 execute_process(
76 COMMAND 91 COMMAND
87 102
88 set(GCP_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/Version.rc) 103 set(GCP_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/Version.rc)
89 endif() 104 endif()
90 105
91 106
92 if (ON) 107 if (NOT ORTHANC_FRAMEWORK_SOURCE STREQUAL "system")
93 # Redefine the list of Orthanc sources, removing unused items, in 108 # Redefine the list of Orthanc sources, removing unused items, in
94 # order to reduce the number of files and speed up the builds 109 # order to reduce the number of files and speed up the builds
95 set(ORTHANC_CORE_SOURCES 110 set(ORTHANC_CORE_SOURCES
96 ${ORTHANC_CORE_SOURCES_DEPENDENCIES} 111 ${ORTHANC_CORE_SOURCES_DEPENDENCIES}
97 ${ORTHANC_FRAMEWORK_ROOT}/Sources/ChunkedBuffer.cpp 112 ${ORTHANC_FRAMEWORK_ROOT}/Sources/ChunkedBuffer.cpp