annotate Aws/CMakeLists.txt @ 104:5f6cb6dff8f4 2.2.0

2.2.0
author Alain Mazy <am@osimis.io>
date Thu, 20 Jul 2023 17:21:44 +0200
parents 431ab61b5760
children 003d21d49019
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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/>.
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
16
56
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
17
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
18 cmake_minimum_required(VERSION 2.8)
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
19
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
20 project(OrthancAwsS3Storage)
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
21
104
Alain Mazy <am@osimis.io>
parents: 83
diff changeset
22 set(PLUGIN_VERSION "2.2.0")
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
23
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
24 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
25 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
26 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
27 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
28 set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.9.3")
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 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
30 endif()
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
31
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
32 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
33 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
34 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
35 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
36 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
37 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
38
38
9c0dfd10d5d0 statically link against libcrypto++
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 35
diff changeset
39 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
40 set(USE_SYSTEM_CRYPTOPP ON CACHE BOOL "Use the system version of crypto++")
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
41
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
42 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
43
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
44 # 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
45 include(${CMAKE_SOURCE_DIR}/../Common/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake)
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
46
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
47 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
48 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
49 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
50 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
51
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
52 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
53 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
54 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
55
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 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
57 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
58 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
59 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
60
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 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
62 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
63 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
64 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
65
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 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
67 endif()
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
68
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
69 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
70
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 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
72 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
73 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
74 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
75
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 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
77 include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkParameters.cmake)
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
78
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
79 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
80 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
81 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
82 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
83 set(ENABLE_MODULE_JOBS 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
84 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
85 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
86
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 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
88
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 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
90 ${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
91 )
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 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
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
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 include(${CMAKE_SOURCE_DIR}/../Common/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake)
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
96
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
97
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
98 add_definitions(
56
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
99 -DHAS_ORTHANC_EXCEPTION=1
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
100 -DORTHANC_ENABLE_LOGGING=1
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
101 -DAWS_STORAGE_PLUGIN=1
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
102 -DPLUGIN_VERSION="${PLUGIN_VERSION}"
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
103 )
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
104
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
105 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
106 ${CMAKE_SOURCE_DIR}/../Common/Resources/Orthanc/Plugins/
f3c44d61e1e1 AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 57
diff changeset
107 ${CMAKE_SOURCE_DIR}/../Common/Resources/Orthanc/Sdk-1.9.2/
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
108 )
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
109
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
110
38
9c0dfd10d5d0 statically link against libcrypto++
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 35
diff changeset
111 if (NOT STATIC_BUILD AND USE_VCPKG_PACKAGES)
9c0dfd10d5d0 statically link against libcrypto++
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 35
diff changeset
112 # Use vcpkg by Microsoft
56
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
113 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
114 find_package(cryptopp CONFIG REQUIRED)
471eaf5c5d39 USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 22
diff changeset
115 find_package(AWSSDK REQUIRED COMPONENTS s3)
471eaf5c5d39 USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 22
diff changeset
116 set(CRYPTOPP_LIBRARIES cryptopp-static)
56
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
117
26
471eaf5c5d39 USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 22
diff changeset
118 else()
38
9c0dfd10d5d0 statically link against libcrypto++
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 35
diff changeset
119 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
120 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
121 endif()
471eaf5c5d39 USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 22
diff changeset
122
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
123
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
124 set(COMMON_SOURCES
78
d7295e8678d7 renames
Alain Mazy <am@osimis.io>
parents: 77
diff changeset
125 ${CMAKE_SOURCE_DIR}/../Common/IStorage.h
d7295e8678d7 renames
Alain Mazy <am@osimis.io>
parents: 77
diff changeset
126 ${CMAKE_SOURCE_DIR}/../Common/BaseStorage.h
d7295e8678d7 renames
Alain Mazy <am@osimis.io>
parents: 77
diff changeset
127 ${CMAKE_SOURCE_DIR}/../Common/BaseStorage.cpp
56
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
128 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.cpp
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
129 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.h
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
130 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.cpp
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
131 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.h
78
d7295e8678d7 renames
Alain Mazy <am@osimis.io>
parents: 77
diff changeset
132 ${CMAKE_SOURCE_DIR}/../Common/FileSystemStorage.h
d7295e8678d7 renames
Alain Mazy <am@osimis.io>
parents: 77
diff changeset
133 ${CMAKE_SOURCE_DIR}/../Common/FileSystemStorage.cpp
83
431ab61b5760 /move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents: 78
diff changeset
134 ${CMAKE_SOURCE_DIR}/../Common/MoveStorageJob.h
431ab61b5760 /move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents: 78
diff changeset
135 ${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
136 ${CMAKE_SOURCE_DIR}/../Common/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
137
56
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
138 ${AWS_SOURCES}
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
139 ${CRYPTOPP_SOURCES}
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
140 ${ORTHANC_CORE_SOURCES}
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
141 )
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
142
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
143 add_library(OrthancAwsS3Storage SHARED
56
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
144 AwsS3StoragePlugin.cpp
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
145 AwsS3StoragePlugin.h
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
146 ${CMAKE_SOURCE_DIR}/../Common/StoragePlugin.cpp
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
147
56
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
148 ${COMMON_SOURCES}
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
149 )
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
150
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
151 set_target_properties(OrthancAwsS3Storage PROPERTIES
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
152 VERSION ${PLUGIN_VERSION}
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
153 SOVERSION ${PLUGIN_VERSION}
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
154 )
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
155
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
156 target_link_libraries(OrthancAwsS3Storage
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
157 PRIVATE
26
471eaf5c5d39 USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 22
diff changeset
158 ${CRYPTOPP_LIBRARIES}
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
159 ${AWSSDK_LINK_LIBRARIES}
56
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
160 ${ORTHANC_FRAMEWORK_LIBRARIES}
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
161 )
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
162
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
163 add_executable(UnitTests
56
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
164 ${GOOGLE_TEST_SOURCES}
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
165 ${COMMON_SOURCES}
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
166
56
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
167 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/EncryptionTests.cpp
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
168 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/UnitTestsMain.cpp
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
169 )
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
170
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
171 target_link_libraries(UnitTests
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
172 PRIVATE
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
173 ${GOOGLE_TEST_LIBRARIES}
26
471eaf5c5d39 USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 22
diff changeset
174 ${CRYPTOPP_LIBRARIES}
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
175 ${AWSSDK_LINK_LIBRARIES}
56
b922ae86bbe1 full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 52
diff changeset
176 ${ORTHANC_FRAMEWORK_LIBRARIES}
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
177 )
26
471eaf5c5d39 USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 22
diff changeset
178
38
9c0dfd10d5d0 statically link against libcrypto++
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 35
diff changeset
179 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
180 add_dependencies(OrthancAwsS3Storage AwsSdkCpp)
471eaf5c5d39 USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 22
diff changeset
181 add_dependencies(UnitTests AwsSdkCpp)
471eaf5c5d39 USE_VCPKG_PACKAGES to avoid using vcpkg
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 22
diff changeset
182 endif()