Mercurial > hg > orthanc-object-storage
annotate Aws/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 | afc642ccb99c |
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:
141
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:
141
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:
141
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/>. |
1 | 18 |
56
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
19 |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
20 cmake_minimum_required(VERSION 2.8) |
1 | 21 |
22 project(OrthancAwsS3Storage) | |
23 | |
202 | 24 set(PLUGIN_VERSION "2.4.0") |
1 | 25 |
59
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
26 if (PLUGIN_VERSION STREQUAL "mainline") |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
27 set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "mainline") |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
28 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
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") |
59
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
31 set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
32 endif() |
1 | 33 |
59
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
34 set(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)") |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
35 set(ALLOW_DOWNLOADS ON CACHE BOOL "Allow CMake to download packages") |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
36 set(ORTHANC_FRAMEWORK_SOURCE "${ORTHANC_FRAMEWORK_DEFAULT_SOURCE}" CACHE STRING "Source of the Orthanc framework (can be \"system\", \"hg\", \"archive\", \"web\" or \"path\")") |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
37 set(ORTHANC_FRAMEWORK_VERSION "${ORTHANC_FRAMEWORK_DEFAULT_VERSION}" CACHE STRING "Version of the Orthanc framework") |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
38 set(ORTHANC_FRAMEWORK_ARCHIVE "" CACHE STRING "Path to the Orthanc archive, if ORTHANC_FRAMEWORK_SOURCE is \"archive\"") |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
39 set(ORTHANC_FRAMEWORK_ROOT "" CACHE STRING "Path to the Orthanc source directory, if ORTHANC_FRAMEWORK_SOURCE is \"path\"") |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
40 |
38
9c0dfd10d5d0
statically link against libcrypto++
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
35
diff
changeset
|
41 set(USE_VCPKG_PACKAGES ON CACHE BOOL "Use Microsoft vcpkg to link against crypto++ and AWS SDK") |
9c0dfd10d5d0
statically link against libcrypto++
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
35
diff
changeset
|
42 set(USE_SYSTEM_CRYPTOPP ON CACHE BOOL "Use the system version of crypto++") |
1 | 43 |
201
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
44 |
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
45 set(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK") |
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
46 set(ORTHANC_SDK_VERSION "1.12.1" CACHE STRING "Version of the Orthanc plugin SDK to use, if not using the system version (can be \"framework\" or \"1.12.1\")") |
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
47 |
59
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
48 include(CheckIncludeFileCXX) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
49 |
1 | 50 # Download and setup the Orthanc framework |
59
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
51 include(${CMAKE_SOURCE_DIR}/../Common/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake) |
1 | 52 |
59
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
53 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system") |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
54 if (ORTHANC_FRAMEWORK_USE_SHARED) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
55 include(FindBoost) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
56 find_package(Boost COMPONENTS filesystem thread) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
57 |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
58 if (NOT Boost_FOUND) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
59 message(FATAL_ERROR "Unable to locate Boost on this system") |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
60 endif() |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
61 |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
62 include(FindOpenSSL) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
63 if (NOT OPENSSL_FOUND) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
64 message(FATAL_ERROR "Unable to find OpenSSL") |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
65 endif() |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
66 |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
67 include(FindCURL) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
68 if (NOT CURL_FOUND) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
69 message(FATAL_ERROR "Unable to find LibCurl") |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
70 endif() |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
71 |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
72 link_libraries(${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${CURL_LIBRARIES} jsoncpp) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
73 endif() |
1 | 74 |
59
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
75 link_libraries(${ORTHANC_FRAMEWORK_LIBRARIES}) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
76 |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
77 set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test") |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
78 set(USE_GOOGLE_TEST_DEBIAN_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)") |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
79 mark_as_advanced(USE_GOOGLE_TEST_DEBIAN_PACKAGE) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
80 include(${CMAKE_SOURCE_DIR}/../Common/Resources/Orthanc/CMake/GoogleTestConfiguration.cmake) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
81 |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
82 else() |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
83 include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkParameters.cmake) |
1 | 84 |
59
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
85 set(ENABLE_CRYPTO_OPTIONS ON) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
86 set(ENABLE_GOOGLE_TEST ON) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
87 set(ENABLE_MODULE_DICOM OFF) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
88 set(ENABLE_MODULE_IMAGES OFF) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
89 set(ENABLE_MODULE_JOBS OFF) |
141
3e9cced85a5b
fix build for MSVC 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
90 set(ENABLE_OPENSSL_ENGINES ON) # Necessary since OpenSSL 3.1.x |
59
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
91 set(ENABLE_WEB_CLIENT ON) # Access options related to curl |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
92 set(ORTHANC_FRAMEWORK_PLUGIN ON) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
93 |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
94 include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkConfiguration.cmake) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
95 |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
96 include_directories( |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
97 ${ORTHANC_FRAMEWORK_ROOT} |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
98 ) |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
99 endif() |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
100 |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
101 |
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
102 include(${CMAKE_SOURCE_DIR}/../Common/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake) |
1 | 103 |
104 | |
201
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
105 if (STATIC_BUILD OR NOT USE_SYSTEM_ORTHANC_SDK) |
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
106 if (ORTHANC_SDK_VERSION STREQUAL "1.12.1") |
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
107 include_directories(${CMAKE_SOURCE_DIR}/../Common/Resources/Orthanc/Sdk-1.12.1/) |
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
108 elseif (ORTHANC_SDK_VERSION STREQUAL "framework") |
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
109 include_directories(${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Include/) |
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
110 else() |
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
111 message(FATAL_ERROR "Unsupported version of the Orthanc plugin SDK: ${ORTHANC_SDK_VERSION}") |
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
112 endif() |
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
113 else () |
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
114 CHECK_INCLUDE_FILE_CXX(orthanc/OrthancCPlugin.h HAVE_ORTHANC_H) |
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
115 if (NOT HAVE_ORTHANC_H) |
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
116 message(FATAL_ERROR "Please install the headers of the Orthanc plugins SDK") |
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
117 endif() |
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
118 endif() |
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
119 |
97f18498af7e
added cmake option ORTHANC_SDK_VERSION
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
197
diff
changeset
|
120 |
205
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
121 if (CMAKE_SYSTEM_NAME STREQUAL "Windows") |
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
122 execute_process( |
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
123 COMMAND |
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
124 ${PYTHON_EXECUTABLE} ${ORTHANC_FRAMEWORK_ROOT}/../Resources/WindowsResources.py |
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
125 ${PLUGIN_VERSION} "AWS S3 plugin" OrthancAwsS3Storage.dll |
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
126 "AWS S3 plugin for Orthanc" |
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
127 ERROR_VARIABLE Failure |
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
128 OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/Version.rc |
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
129 ) |
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
130 |
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
131 if (Failure) |
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
132 message(FATAL_ERROR "Error while computing the version information: ${Failure}") |
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
133 endif() |
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
134 |
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
135 list(APPEND AUTOGENERATED_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/Version.rc) |
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
136 endif() |
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
137 |
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
138 |
1 | 139 add_definitions( |
56
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
140 -DHAS_ORTHANC_EXCEPTION=1 |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
141 -DORTHANC_ENABLE_LOGGING=1 |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
142 -DAWS_STORAGE_PLUGIN=1 |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
143 -DPLUGIN_VERSION="${PLUGIN_VERSION}" |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
144 ) |
1 | 145 |
146 include_directories( | |
59
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
147 ${CMAKE_SOURCE_DIR}/../Common/Resources/Orthanc/Plugins/ |
1 | 148 ) |
149 | |
150 | |
38
9c0dfd10d5d0
statically link against libcrypto++
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
35
diff
changeset
|
151 if (NOT STATIC_BUILD AND USE_VCPKG_PACKAGES) |
9c0dfd10d5d0
statically link against libcrypto++
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
35
diff
changeset
|
152 # Use vcpkg by Microsoft |
56
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
153 option(BUILD_SHARED_LIBS "Build shared libraries" ON) |
26
471eaf5c5d39
USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
22
diff
changeset
|
154 find_package(cryptopp CONFIG REQUIRED) |
106
c9356e42af99
added TransferMode for S3 (currently affected by https://github.com/aws/aws-sdk-cpp/issues/2319 since we are using version 1.9.45)
Alain Mazy <am@osimis.io>
parents:
105
diff
changeset
|
155 find_package(AWSSDK REQUIRED COMPONENTS s3 transfer) |
26
471eaf5c5d39
USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
22
diff
changeset
|
156 set(CRYPTOPP_LIBRARIES cryptopp-static) |
56
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
157 |
26
471eaf5c5d39
USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
22
diff
changeset
|
158 else() |
38
9c0dfd10d5d0
statically link against libcrypto++
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
35
diff
changeset
|
159 include(${CMAKE_SOURCE_DIR}/../Common/CryptoPPConfiguration.cmake) |
56
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
160 include(${CMAKE_SOURCE_DIR}/AwsStaticConfiguration.cmake) |
26
471eaf5c5d39
USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
22
diff
changeset
|
161 endif() |
471eaf5c5d39
USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
22
diff
changeset
|
162 |
1 | 163 |
164 set(COMMON_SOURCES | |
78 | 165 ${CMAKE_SOURCE_DIR}/../Common/IStorage.h |
166 ${CMAKE_SOURCE_DIR}/../Common/BaseStorage.h | |
167 ${CMAKE_SOURCE_DIR}/../Common/BaseStorage.cpp | |
56
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
168 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.cpp |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
169 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.h |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
170 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.cpp |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
171 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.h |
78 | 172 ${CMAKE_SOURCE_DIR}/../Common/FileSystemStorage.h |
173 ${CMAKE_SOURCE_DIR}/../Common/FileSystemStorage.cpp | |
83
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
78
diff
changeset
|
174 ${CMAKE_SOURCE_DIR}/../Common/MoveStorageJob.h |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
78
diff
changeset
|
175 ${CMAKE_SOURCE_DIR}/../Common/MoveStorageJob.cpp |
59
f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
176 ${CMAKE_SOURCE_DIR}/../Common/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp |
1 | 177 |
56
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
178 ${AWS_SOURCES} |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
179 ${CRYPTOPP_SOURCES} |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
180 ${ORTHANC_CORE_SOURCES} |
1 | 181 ) |
182 | |
183 add_library(OrthancAwsS3Storage SHARED | |
56
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
184 AwsS3StoragePlugin.cpp |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
185 AwsS3StoragePlugin.h |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
186 ${CMAKE_SOURCE_DIR}/../Common/StoragePlugin.cpp |
1 | 187 |
56
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
188 ${COMMON_SOURCES} |
205
70caa95a9072
added Windows resources to the DLL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
202
diff
changeset
|
189 ${AUTOGENERATED_SOURCES} |
56
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
190 ) |
1 | 191 |
192 set_target_properties(OrthancAwsS3Storage PROPERTIES | |
193 VERSION ${PLUGIN_VERSION} | |
194 SOVERSION ${PLUGIN_VERSION} | |
195 ) | |
196 | |
197 target_link_libraries(OrthancAwsS3Storage | |
198 PRIVATE | |
26
471eaf5c5d39
USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
22
diff
changeset
|
199 ${CRYPTOPP_LIBRARIES} |
1 | 200 ${AWSSDK_LINK_LIBRARIES} |
56
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
201 ${ORTHANC_FRAMEWORK_LIBRARIES} |
1 | 202 ) |
203 | |
204 | |
131 | 205 install( |
206 TARGETS OrthancAwsS3Storage | |
207 RUNTIME DESTINATION lib # Destination for Windows | |
208 LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux | |
209 ) | |
210 | |
1 | 211 |
212 add_executable(UnitTests | |
56
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
213 ${GOOGLE_TEST_SOURCES} |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
214 ${COMMON_SOURCES} |
1 | 215 |
56
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
216 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/EncryptionTests.cpp |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
217 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/UnitTestsMain.cpp |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
218 ) |
1 | 219 |
220 target_link_libraries(UnitTests | |
221 PRIVATE | |
222 ${GOOGLE_TEST_LIBRARIES} | |
26
471eaf5c5d39
USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
22
diff
changeset
|
223 ${CRYPTOPP_LIBRARIES} |
1 | 224 ${AWSSDK_LINK_LIBRARIES} |
56
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
52
diff
changeset
|
225 ${ORTHANC_FRAMEWORK_LIBRARIES} |
1 | 226 ) |
26
471eaf5c5d39
USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
22
diff
changeset
|
227 |
38
9c0dfd10d5d0
statically link against libcrypto++
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
35
diff
changeset
|
228 if (STATIC_BUILD OR NOT USE_VCPKG_PACKAGES) |
26
471eaf5c5d39
USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
22
diff
changeset
|
229 add_dependencies(OrthancAwsS3Storage AwsSdkCpp) |
471eaf5c5d39
USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
22
diff
changeset
|
230 add_dependencies(UnitTests AwsSdkCpp) |
471eaf5c5d39
USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
22
diff
changeset
|
231 endif() |
146
5decdf0f0ef7
trying to build aws for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
145
diff
changeset
|
232 |
5decdf0f0ef7
trying to build aws for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
145
diff
changeset
|
233 if (COMMAND DefineSourceBasenameForTarget) |
5decdf0f0ef7
trying to build aws for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
145
diff
changeset
|
234 DefineSourceBasenameForTarget(OrthancAwsS3Storage) |
5decdf0f0ef7
trying to build aws for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
145
diff
changeset
|
235 DefineSourceBasenameForTarget(UnitTests) |
5decdf0f0ef7
trying to build aws for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
145
diff
changeset
|
236 endif() |