Mercurial > hg > orthanc-object-storage
annotate Google/CMakeLists.txt @ 205:70caa95a9072 2.4.0
added Windows resources to the DLL
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 26 Jun 2024 16:16:24 +0200 |
parents | bb19f1ed9cd9 |
children | 55fab84a0674 |
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 |
145
3c7e0374f28e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
2 # Copyright (C) 2020-2023 Osimis S.A., Belgium |
3c7e0374f28e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
3 # Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
3c7e0374f28e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
4 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
56
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
5 # |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
6 # 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
|
7 # 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
|
8 # 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
|
9 # 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
|
10 # |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
11 # 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
|
12 # 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
|
13 # 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
|
14 # Affero General Public License for more details. |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
15 # |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
16 # 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
|
17 # 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
|
18 |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
19 |
109
2549eecdc996
updated minimum cmake version for Azure & Google
Alain Mazy <am@osimis.io>
parents:
108
diff
changeset
|
20 cmake_minimum_required(VERSION 3.3) |
1 | 21 |
22 project(OrthancGoogleCloudStorage) | |
23 | |
202 | 24 set(PLUGIN_VERSION "2.4.0") |
1 | 25 |
129 | 26 if (PLUGIN_VERSION STREQUAL "mainline") |
27 set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "mainline") | |
28 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") | |
29 else() | |
146
5decdf0f0ef7
trying to build aws for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
145
diff
changeset
|
30 set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.12.4") |
134 | 31 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") |
129 | 32 endif() |
1 | 33 |
129 | 34 set(ORTHANC_FRAMEWORK_SOURCE "${ORTHANC_FRAMEWORK_DEFAULT_SOURCE}" CACHE STRING "Source of the Orthanc framework (can be \"system\", \"hg\", \"archive\", \"web\" or \"path\")") |
35 set(ORTHANC_FRAMEWORK_VERSION "${ORTHANC_FRAMEWORK_DEFAULT_VERSION}" CACHE STRING "Version of the Orthanc framework") | |
36 set(ORTHANC_FRAMEWORK_ARCHIVE "" CACHE STRING "Path to the Orthanc archive, if ORTHANC_FRAMEWORK_SOURCE is \"archive\"") | |
37 set(ORTHANC_FRAMEWORK_ROOT "" CACHE STRING "Path to the Orthanc source directory, if ORTHANC_FRAMEWORK_SOURCE is \"path\"") | |
1 | 38 set(ALLOW_DOWNLOADS ON) |
39 | |
40 | |
41 include(CheckIncludeFileCXX) | |
42 | |
43 # Download and setup the Orthanc framework | |
44 | |
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
|
45 include(${CMAKE_SOURCE_DIR}/../Common/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake) |
15 | 46 include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkParameters.cmake) |
1 | 47 |
48 set(ENABLE_GOOGLE_TEST ON) | |
49 set(ORTHANC_FRAMEWORK_PLUGIN ON) | |
22
319d41a22de4
more lightweight use of Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
18
diff
changeset
|
50 set(ENABLE_MODULE_IMAGES OFF) |
319d41a22de4
more lightweight use of Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
18
diff
changeset
|
51 set(ENABLE_MODULE_JOBS OFF) |
319d41a22de4
more lightweight use of Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
18
diff
changeset
|
52 set(ENABLE_MODULE_DICOM OFF) |
1 | 53 |
15 | 54 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
|
55 include(${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common/OrthancPluginsExports.cmake) |
1 | 56 |
57 | |
58 add_definitions( | |
59 -DHAS_ORTHANC_EXCEPTION=1 | |
15 | 60 -DORTHANC_ENABLE_LOGGING=1 |
1 | 61 -DGOOGLE_STORAGE_PLUGIN=1 |
62 ) | |
63 add_definitions(-DPLUGIN_VERSION="${PLUGIN_VERSION}") | |
64 | |
65 include_directories( | |
15 | 66 ${ORTHANC_FRAMEWORK_ROOT} |
67 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Include | |
68 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common | |
1 | 69 ) |
70 | |
71 find_package(CURL REQUIRED) | |
101
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
72 find_package(google_cloud_cpp_storage REQUIRED) |
1 | 73 find_package(cryptopp CONFIG REQUIRED) |
74 | |
101
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
75 set(CMAKE_CXX_STANDARD 14) |
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
76 |
1 | 77 set(COMMON_SOURCES |
78 | 78 ${CMAKE_SOURCE_DIR}/../Common/IStorage.h |
79 ${CMAKE_SOURCE_DIR}/../Common/BaseStorage.h | |
80 ${CMAKE_SOURCE_DIR}/../Common/BaseStorage.cpp | |
1 | 81 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.cpp |
82 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.h | |
83 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.cpp | |
84 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.h | |
78 | 85 ${CMAKE_SOURCE_DIR}/../Common/FileSystemStorage.h |
86 ${CMAKE_SOURCE_DIR}/../Common/FileSystemStorage.cpp | |
83
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
78
diff
changeset
|
87 ${CMAKE_SOURCE_DIR}/../Common/MoveStorageJob.h |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
78
diff
changeset
|
88 ${CMAKE_SOURCE_DIR}/../Common/MoveStorageJob.cpp |
15 | 89 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp |
1 | 90 |
91 ${ORTHANC_CORE_SOURCES} | |
92 ) | |
93 | |
94 add_library(OrthancGoogleCloudStorage SHARED | |
95 GoogleStoragePlugin.cpp | |
96 GoogleStoragePlugin.h | |
97 ${CMAKE_SOURCE_DIR}/../Common/StoragePlugin.cpp | |
98 | |
99 ${COMMON_SOURCES} | |
100 ) | |
101 | |
132
573585bcc9ff
fix test about presence of DefineSourceBasenameForTarget
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
131
diff
changeset
|
102 if (COMMAND DefineSourceBasenameForTarget) |
130
17f350ab12ca
conditional usage of DefineSourceBasenameForTarget
Alain Mazy <am@osimis.io>
parents:
129
diff
changeset
|
103 DefineSourceBasenameForTarget(OrthancGoogleCloudStorage) |
17f350ab12ca
conditional usage of DefineSourceBasenameForTarget
Alain Mazy <am@osimis.io>
parents:
129
diff
changeset
|
104 endif() |
17f350ab12ca
conditional usage of DefineSourceBasenameForTarget
Alain Mazy <am@osimis.io>
parents:
129
diff
changeset
|
105 |
105 | 106 |
1 | 107 set_target_properties(OrthancGoogleCloudStorage PROPERTIES |
108 VERSION ${PLUGIN_VERSION} | |
109 SOVERSION ${PLUGIN_VERSION} | |
110 ) | |
111 | |
112 target_link_libraries(OrthancGoogleCloudStorage | |
113 PRIVATE | |
101
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
114 CURL::libcurl |
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
115 google-cloud-cpp::storage |
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
116 google-cloud-cpp::experimental-storage-grpc |
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
117 cryptopp::cryptopp |
1 | 118 ) |
119 | |
131 | 120 install( |
121 TARGETS OrthancGoogleCloudStorage | |
122 RUNTIME DESTINATION lib # Destination for Windows | |
123 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | |
124 ) | |
125 | |
1 | 126 add_executable(UnitTests |
127 ${GOOGLE_TEST_SOURCES} | |
128 ${COMMON_SOURCES} | |
129 | |
130 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/EncryptionTests.cpp | |
131 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/UnitTestsMain.cpp | |
132 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/UnitTestsGcsClient.cpp | |
133 ) | |
134 | |
135 target_link_libraries(UnitTests | |
136 PRIVATE | |
101
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
137 CURL::libcurl |
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
138 google-cloud-cpp::storage |
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
139 google-cloud-cpp::experimental-storage-grpc |
57be7094d6c5
updated Google plugin for latest SDK
Alain Mazy <am@osimis.io>
parents:
83
diff
changeset
|
140 cryptopp::cryptopp |
1 | 141 ${GOOGLE_TEST_LIBRARIES} |
142 ) |