comparison CMakeLists.txt @ 0:520cba9a0d42

initial commit
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 13 Jun 2019 14:57:22 +0200
parents
children 83bafd79af97 7d2bc8ac883e
comparison
equal deleted inserted replaced
-1:000000000000 0:520cba9a0d42
1 cmake_minimum_required(VERSION 2.8)
2
3 project(GoogleCloudPlatform)
4
5 set(GCP_PLUGIN_VERSION "mainline")
6
7 # TODO - Update to 1.5.7 once available
8
9 if (GCP_PLUGIN_VERSION STREQUAL "mainline")
10 set(ORTHANC_FRAMEWORK_VERSION "1.5.6")
11 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg")
12 else()
13 set(ORTHANC_FRAMEWORK_VERSION "1.5.6")
14 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web")
15 endif()
16
17
18 # Parameters of the build
19 set(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)")
20 set(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages")
21 set(ORTHANC_FRAMEWORK_SOURCE "${ORTHANC_FRAMEWORK_DEFAULT_SOURCE}" CACHE STRING "Source of the Orthanc source code (can be \"hg\", \"archive\", \"web\" or \"path\")")
22 set(ORTHANC_FRAMEWORK_ARCHIVE "" CACHE STRING "Path to the Orthanc archive, if ORTHANC_FRAMEWORK_SOURCE is \"archive\"")
23 set(ORTHANC_FRAMEWORK_ROOT "" CACHE STRING "Path to the Orthanc source directory, if ORTHANC_FRAMEWORK_SOURCE is \"path\"")
24
25 # Advanced parameters to fine-tune linking against system libraries
26 set(USE_SYSTEM_GDCM ON CACHE BOOL "Use the system version of Grassroot DICOM (GDCM)")
27 set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK")
28 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\", or \"framework\")")
29
30
31 include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/DownloadOrthancFramework.cmake)
32
33 include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake)
34
35 set(ENABLE_CRYPTO_OPTIONS ON)
36 set(ENABLE_ZLIB ON)
37 set(ENABLE_WEB_CLIENT ON)
38 set(ENABLE_OPENSSL_ENGINES OFF)
39
40 include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake)
41
42 include(${CMAKE_SOURCE_DIR}/Resources/CMake/CRC32C.cmake)
43 include(${CMAKE_SOURCE_DIR}/Resources/CMake/NlohmannJson.cmake)
44 include(${CMAKE_SOURCE_DIR}/Resources/CMake/GoogleCloudPlatform.cmake)
45
46
47 if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK)
48 if (ORTHANC_SDK_VERSION STREQUAL "1.0.0")
49 include_directories(${CMAKE_SOURCE_DIR}/Resources/Orthanc/Sdk-1.0.0)
50 elseif (ORTHANC_SDK_VERSION STREQUAL "framework")
51 include_directories(${ORTHANC_ROOT}/Plugins/Include)
52 else()
53 message(FATAL_ERROR "Unsupported version of the Orthanc plugin SDK: ${ORTHANC_SDK_VERSION}")
54 endif()
55 else ()
56 CHECK_INCLUDE_FILE_CXX(orthanc/OrthancCPlugin.h HAVE_ORTHANC_H)
57 if (NOT HAVE_ORTHANC_H)
58 message(FATAL_ERROR "Please install the headers of the Orthanc plugins SDK")
59 endif()
60 endif()
61
62
63
64 add_definitions(
65 -DHAS_ORTHANC_EXCEPTION=1
66 -DORTHANC_ENABLE_LOGGING=1
67 -DORTHANC_ENABLE_LOGGING_PLUGIN=1
68 -DGCP_PLUGIN_VERSION="${GCP_PLUGIN_VERSION}"
69 )
70
71 include_directories(
72 ${AUTOGENERATED_DIR}
73 ${ORTHANC_ROOT}
74 )
75
76 add_library(OrthancGoogleCloudPlatform SHARED
77 ${ORTHANC_ROOT}/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
78 Plugin/GoogleAccount.cpp
79 Plugin/GoogleConfiguration.cpp
80 Plugin/GoogleUpdater.cpp
81 Plugin/Plugin.cpp
82
83 ${CRC32C_SOURCES}
84 ${CURL_SOURCES}
85 ${GCP_SOURCES}
86 ${OPENSSL_SOURCES}
87 ${ZLIB_SOURCES}
88 ${ORTHANC_CORE_SOURCES}
89 )
90
91 set_target_properties(OrthancGoogleCloudPlatform PROPERTIES
92 VERSION ${GCP_PLUGIN_VERSION}
93 SOVERSION ${GCP_PLUGIN_VERSION})
94
95 install(
96 TARGETS OrthancGoogleCloudPlatform
97 RUNTIME DESTINATION lib # Destination for Windows
98 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux
99 )