Mercurial > hg > orthanc-object-storage
annotate Google/CMakeLists.txt @ 135:02168cb50699
back to mainline
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 20 Dec 2023 16:05:41 +0100 |
parents | f35c3281e62f |
children | 3c7e0374f28e |
rev | line source |
---|---|
56
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
1 # Cloud storage plugins for Orthanc |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
2 # Copyright (C) 2020-2021 Osimis S.A., Belgium |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
3 # |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
4 # This program is free software: you can redistribute it and/or |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
5 # modify it under the terms of the GNU Affero General Public License |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
6 # as published by the Free Software Foundation, either version 3 of |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
7 # the License, or (at your option) any later version. |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
8 # |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
9 # This program is distributed in the hope that it will be useful, but |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
10 # WITHOUT ANY WARRANTY; without even the implied warranty of |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
12 # Affero General Public License for more details. |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
13 # |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
14 # You should have received a copy of the GNU Affero General Public License |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
15 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
16 |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
17 |
109
2549eecdc996
updated minimum cmake version for Azure & Google
Alain Mazy <am@osimis.io>
parents:
108
diff
changeset
|
18 cmake_minimum_required(VERSION 3.3) |
1 | 19 |
20 project(OrthancGoogleCloudStorage) | |
21 | |
135 | 22 set(PLUGIN_VERSION "mainline") |
1 | 23 |
129 | 24 if (PLUGIN_VERSION STREQUAL "mainline") |
25 set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "mainline") | |
26 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") | |
27 else() | |
134 | 28 set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.12.2") |
29 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") | |
129 | 30 endif() |
1 | 31 |
129 | 32 set(ORTHANC_FRAMEWORK_SOURCE "${ORTHANC_FRAMEWORK_DEFAULT_SOURCE}" CACHE STRING "Source of the Orthanc framework (can be \"system\", \"hg\", \"archive\", \"web\" or \"path\")") |
33 set(ORTHANC_FRAMEWORK_VERSION "${ORTHANC_FRAMEWORK_DEFAULT_VERSION}" CACHE STRING "Version of the Orthanc framework") | |
34 set(ORTHANC_FRAMEWORK_ARCHIVE "" CACHE STRING "Path to the Orthanc archive, if ORTHANC_FRAMEWORK_SOURCE is \"archive\"") | |
35 set(ORTHANC_FRAMEWORK_ROOT "" CACHE STRING "Path to the Orthanc source directory, if ORTHANC_FRAMEWORK_SOURCE is \"path\"") | |
1 | 36 set(ALLOW_DOWNLOADS ON) |
37 | |
129 | 38 |
39 include(CheckIncludeFileCXX) | |
40 | |
1 | 41 # Download and setup the Orthanc framework |
42 | |
59
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
56
diff
changeset
|
43 include(${CMAKE_SOURCE_DIR}/../Common/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake) |
15 | 44 include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkParameters.cmake) |
1 | 45 |
46 set(ENABLE_GOOGLE_TEST ON) | |
47 set(ORTHANC_FRAMEWORK_PLUGIN ON) | |
22
319d41a22de4
more lightweight use of Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
18
diff
changeset
|
48 set(ENABLE_MODULE_IMAGES OFF) |
319d41a22de4
more lightweight use of Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
18
diff
changeset
|
49 set(ENABLE_MODULE_JOBS OFF) |
319d41a22de4
more lightweight use of Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
18
diff
changeset
|
50 set(ENABLE_MODULE_DICOM OFF) |
1 | 51 |
15 | 52 include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkConfiguration.cmake) |
18
44de9edf2443
fix compilation to avoid exposing internal symbols which caused a crash at Orthanc startup
Alain Mazy
parents:
15
diff
changeset
|
53 include(${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common/OrthancPluginsExports.cmake) |
1 | 54 |
55 | |
56 add_definitions( | |
57 -DHAS_ORTHANC_EXCEPTION=1 | |
15 | 58 -DORTHANC_ENABLE_LOGGING=1 |
1 | 59 -DGOOGLE_STORAGE_PLUGIN=1 |
60 ) | |
61 add_definitions(-DPLUGIN_VERSION="${PLUGIN_VERSION}") | |
62 | |
63 include_directories( | |
15 | 64 ${ORTHANC_FRAMEWORK_ROOT} |
65 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Include | |
66 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common | |
1 | 67 ) |
68 | |
69 find_package(CURL REQUIRED) | |
101
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
70 find_package(google_cloud_cpp_storage REQUIRED) |
1 | 71 find_package(cryptopp CONFIG REQUIRED) |
72 | |
101
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
73 set(CMAKE_CXX_STANDARD 14) |
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
74 |
1 | 75 set(COMMON_SOURCES |
78 | 76 ${CMAKE_SOURCE_DIR}/../Common/IStorage.h |
77 ${CMAKE_SOURCE_DIR}/../Common/BaseStorage.h | |
78 ${CMAKE_SOURCE_DIR}/../Common/BaseStorage.cpp | |
1 | 79 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.cpp |
80 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.h | |
81 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.cpp | |
82 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.h | |
78 | 83 ${CMAKE_SOURCE_DIR}/../Common/FileSystemStorage.h |
84 ${CMAKE_SOURCE_DIR}/../Common/FileSystemStorage.cpp | |
83
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
78
diff
changeset
|
85 ${CMAKE_SOURCE_DIR}/../Common/MoveStorageJob.h |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
78
diff
changeset
|
86 ${CMAKE_SOURCE_DIR}/../Common/MoveStorageJob.cpp |
15 | 87 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp |
1 | 88 |
89 ${ORTHANC_CORE_SOURCES} | |
90 ) | |
91 | |
92 add_library(OrthancGoogleCloudStorage SHARED | |
93 GoogleStoragePlugin.cpp | |
94 GoogleStoragePlugin.h | |
95 ${CMAKE_SOURCE_DIR}/../Common/StoragePlugin.cpp | |
96 | |
97 ${COMMON_SOURCES} | |
98 ) | |
99 | |
132
573585bcc9ff
fix test about presence of DefineSourceBasenameForTarget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
131
diff
changeset
|
100 if (COMMAND DefineSourceBasenameForTarget) |
130
17f350ab12ca
conditional usage of DefineSourceBasenameForTarget
Alain Mazy <am@osimis.io>
parents:
129
diff
changeset
|
101 DefineSourceBasenameForTarget(OrthancGoogleCloudStorage) |
17f350ab12ca
conditional usage of DefineSourceBasenameForTarget
Alain Mazy <am@osimis.io>
parents:
129
diff
changeset
|
102 endif() |
17f350ab12ca
conditional usage of DefineSourceBasenameForTarget
Alain Mazy <am@osimis.io>
parents:
129
diff
changeset
|
103 |
105 | 104 |
1 | 105 set_target_properties(OrthancGoogleCloudStorage PROPERTIES |
106 VERSION ${PLUGIN_VERSION} | |
107 SOVERSION ${PLUGIN_VERSION} | |
108 ) | |
109 | |
110 target_link_libraries(OrthancGoogleCloudStorage | |
111 PRIVATE | |
101
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
112 CURL::libcurl |
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
113 google-cloud-cpp::storage |
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
114 google-cloud-cpp::experimental-storage-grpc |
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
115 cryptopp::cryptopp |
1 | 116 ) |
117 | |
131 | 118 install( |
119 TARGETS OrthancGoogleCloudStorage | |
120 RUNTIME DESTINATION lib # Destination for Windows | |
121 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | |
122 ) | |
123 | |
1 | 124 add_executable(UnitTests |
125 ${GOOGLE_TEST_SOURCES} | |
126 ${COMMON_SOURCES} | |
127 | |
128 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/EncryptionTests.cpp | |
129 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/UnitTestsMain.cpp | |
130 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/UnitTestsGcsClient.cpp | |
131 ) | |
132 | |
133 target_link_libraries(UnitTests | |
134 PRIVATE | |
101
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
135 CURL::libcurl |
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
136 google-cloud-cpp::storage |
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
137 google-cloud-cpp::experimental-storage-grpc |
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
138 cryptopp::cryptopp |
1 | 139 ${GOOGLE_TEST_LIBRARIES} |
140 ) |