Mercurial > hg > orthanc-object-storage
annotate Azure/CMakeLists.txt @ 59:f3c44d61e1e1
AWS S3: Support of dynamic linking against the system-wide Orthanc framework library
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 23 Jun 2021 09:22:22 +0200 |
parents | b922ae86bbe1 |
children | 5fed32546d27 0de1f4e14c1e 02ae7356948c 39707bf9f1f2 dee640a31111 80792bb9600e |
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 |
1 | 18 cmake_minimum_required(VERSION 2.8) |
19 | |
20 project(OrthancAzureBlobStorage) | |
21 | |
52 | 22 set(PLUGIN_VERSION "mainline") |
1 | 23 |
24 include(CheckIncludeFileCXX) | |
25 | |
26 set(ORTHANC_FRAMEWORK_SOURCE "hg" CACHE STRING "orthanc source") | |
49 | 27 set(ORTHANC_FRAMEWORK_VERSION "1.9.2" CACHE STRING "orthanc framework version") |
1 | 28 set(ALLOW_DOWNLOADS ON) |
29 | |
30 # Download and setup the Orthanc framework | |
31 | |
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
|
32 include(${CMAKE_SOURCE_DIR}/../Common/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake) |
15 | 33 include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkParameters.cmake) |
1 | 34 |
35 set(ENABLE_GOOGLE_TEST ON) | |
36 set(ORTHANC_FRAMEWORK_PLUGIN ON) | |
22
319d41a22de4
more lightweight use of Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
18
diff
changeset
|
37 set(ENABLE_MODULE_IMAGES OFF) |
319d41a22de4
more lightweight use of Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
18
diff
changeset
|
38 set(ENABLE_MODULE_JOBS OFF) |
319d41a22de4
more lightweight use of Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
18
diff
changeset
|
39 set(ENABLE_MODULE_DICOM OFF) |
1 | 40 |
15 | 41 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
|
42 include(${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common/OrthancPluginsExports.cmake) |
1 | 43 |
44 add_definitions( | |
45 -DHAS_ORTHANC_EXCEPTION=1 | |
15 | 46 -DORTHANC_ENABLE_LOGGING=1 |
1 | 47 -DAZURE_STORAGE_PLUGIN=1 |
48 ) | |
49 add_definitions(-DPLUGIN_VERSION="${PLUGIN_VERSION}") | |
50 | |
51 include_directories( | |
15 | 52 ${ORTHANC_FRAMEWORK_ROOT} |
53 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Include | |
54 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common | |
1 | 55 ) |
56 | |
57 | |
58 find_package(cryptopp CONFIG REQUIRED) | |
59 | |
60 # Azure stuff (from https://github.com/Microsoft/vcpkg/issues/6277) | |
34 | 61 if (NOT WIN32) |
62 find_package(cpprestsdk CONFIG REQUIRED) | |
63 find_path(WASTORAGE_INCLUDE_DIR was/blob.h) | |
64 find_library(WASTORAGE_LIBRARY azurestorage) | |
65 find_package(Boost REQUIRED COMPONENTS log) | |
66 find_library(UUID_LIBRARY uuid) | |
67 find_package(LibXml2 REQUIRED) | |
68 else() # inspired from https://github.com/phongcao/azure-storage-cpp-sas-sample/blob/master/CMakeLists.txt | |
69 find_path(WASTORAGE_INCLUDE_DIR was/blob.h) | |
70 find_library(CPPREST_LIBRARY | |
71 NAMES cpprest cpprest_2_10) | |
72 find_library(WASTORAGE_LIBRARY wastorage) | |
1 | 73 |
34 | 74 set (CMAKE_CXX_STANDARD 11) |
75 set (CMAKE_CXX_STANDARD_REQUIRED ON) | |
76 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa") | |
77 set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi") | |
78 set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF") | |
79 | |
80 add_definitions(-D_NO_WASTORAGE_API=1) # from https://github.com/Azure/azure-storage-cpp/issues/263 | |
81 endif() | |
82 | |
83 | |
84 if (NOT WIN32) | |
85 include_directories(${WASTORAGE_INCLUDE_DIR}) | |
86 endif() | |
1 | 87 |
88 set(COMMON_SOURCES | |
89 ${CMAKE_SOURCE_DIR}/../Common/IStoragePlugin.h | |
15 | 90 ${CMAKE_SOURCE_DIR}/../Common/BaseStoragePlugin.h |
91 ${CMAKE_SOURCE_DIR}/../Common/BaseStoragePlugin.cpp | |
1 | 92 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.cpp |
93 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.h | |
94 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.cpp | |
95 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.h | |
15 | 96 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp |
1 | 97 |
98 ${ORTHANC_CORE_SOURCES} | |
99 ) | |
100 | |
101 add_library(OrthancAzureBlobStorage SHARED | |
102 AzureBlobStoragePlugin.cpp | |
103 AzureBlobStoragePlugin.h | |
104 ${CMAKE_SOURCE_DIR}/../Common/StoragePlugin.cpp | |
105 | |
106 ${COMMON_SOURCES} | |
107 ) | |
108 | |
109 set_target_properties(OrthancAzureBlobStorage PROPERTIES | |
110 VERSION ${PLUGIN_VERSION} | |
111 SOVERSION ${PLUGIN_VERSION} | |
112 ) | |
113 | |
34 | 114 if (NOT WIN32) |
115 | |
116 target_link_libraries(OrthancAzureBlobStorage | |
117 PRIVATE | |
118 cryptopp-static | |
119 ${WASTORAGE_LIBRARY} | |
120 ${UUID_LIBRARY} | |
121 ${Boost_LIBRARIES} | |
122 ${LIBXML2_LIBRARIES} | |
123 cpprestsdk::cpprest | |
124 ) | |
125 else() | |
126 target_link_libraries(OrthancAzureBlobStorage | |
127 PRIVATE | |
128 cryptopp-static | |
129 ${OPENSSL_LIBRARY} | |
130 ${WASTORAGE_LIBRARY} | |
131 ${CPPREST_LIBRARY} | |
132 Winhttp.lib | |
133 Crypt32.lib | |
134 xmllite.lib | |
1 | 135 ) |
136 | |
34 | 137 endif() |
1 | 138 |
139 | |
34 | 140 # add_executable(UnitTests |
141 # ${GOOGLE_TEST_SOURCES} | |
142 # ${COMMON_SOURCES} | |
143 | |
144 # ${CMAKE_SOURCE_DIR}/../UnitTestsSources/EncryptionTests.cpp | |
145 # ${CMAKE_SOURCE_DIR}/../UnitTestsSources/UnitTestsMain.cpp | |
146 # ) | |
1 | 147 |
34 | 148 # target_link_libraries(UnitTests |
149 # PRIVATE | |
150 # cryptopp-static | |
151 # ${GOOGLE_TEST_LIBRARIES} | |
152 # ${WASTORAGE_LIBRARY} | |
153 # # ${UUID_LIBRARY} | |
154 # # ${Boost_LIBRARIES} | |
155 # # ${LIBXML2_LIBRARIES} | |
156 # cpprestsdk::cpprest | |
157 # ) |