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