Mercurial > hg > orthanc-object-storage
annotate Azure/CMakeLists.txt @ 21:e568ca940ddd 1.1.0
1.1.0
author | Alain Mazy |
---|---|
date | Mon, 07 Sep 2020 14:13:38 +0200 |
parents | 44de9edf2443 |
children | 1691da4ae9c3 |
rev | line source |
---|---|
1 | 1 cmake_minimum_required(VERSION 2.8) |
2 | |
3 project(OrthancAzureBlobStorage) | |
4 | |
21 | 5 set(PLUGIN_VERSION "1.1.0") |
1 | 6 |
7 include(CheckIncludeFileCXX) | |
8 | |
9 set(ORTHANC_FRAMEWORK_SOURCE "hg" CACHE STRING "orthanc source") | |
15 | 10 set(ORTHANC_FRAMEWORK_VERSION "1.7.3" 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) | |
20 | |
15 | 21 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
|
22 include(${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common/OrthancPluginsExports.cmake) |
1 | 23 |
24 add_definitions( | |
25 -DHAS_ORTHANC_EXCEPTION=1 | |
15 | 26 -DORTHANC_ENABLE_LOGGING=1 |
1 | 27 -DAZURE_STORAGE_PLUGIN=1 |
28 ) | |
29 add_definitions(-DPLUGIN_VERSION="${PLUGIN_VERSION}") | |
30 | |
31 include_directories( | |
15 | 32 ${ORTHANC_FRAMEWORK_ROOT} |
33 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Include | |
34 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common | |
1 | 35 ) |
36 | |
37 | |
38 find_package(cryptopp CONFIG REQUIRED) | |
39 | |
40 # Azure stuff (from https://github.com/Microsoft/vcpkg/issues/6277) | |
41 find_package(cpprestsdk CONFIG REQUIRED) | |
42 find_path(WASTORAGE_INCLUDE_DIR was/blob.h) | |
43 find_library(WASTORAGE_LIBRARY azurestorage) | |
44 find_package(Boost REQUIRED COMPONENTS log) | |
45 find_library(UUID_LIBRARY uuid) | |
46 find_package(LibXml2 REQUIRED) | |
47 | |
48 include_directories(${WASTORAGE_INCLUDE_DIR}) | |
49 | |
50 set(COMMON_SOURCES | |
51 ${CMAKE_SOURCE_DIR}/../Common/IStoragePlugin.h | |
15 | 52 ${CMAKE_SOURCE_DIR}/../Common/BaseStoragePlugin.h |
53 ${CMAKE_SOURCE_DIR}/../Common/BaseStoragePlugin.cpp | |
1 | 54 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.cpp |
55 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.h | |
56 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.cpp | |
57 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.h | |
15 | 58 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp |
1 | 59 |
60 ${ORTHANC_CORE_SOURCES} | |
61 ) | |
62 | |
63 add_library(OrthancAzureBlobStorage SHARED | |
64 AzureBlobStoragePlugin.cpp | |
65 AzureBlobStoragePlugin.h | |
66 ${CMAKE_SOURCE_DIR}/../Common/StoragePlugin.cpp | |
67 | |
68 ${COMMON_SOURCES} | |
69 ) | |
70 | |
71 set_target_properties(OrthancAzureBlobStorage PROPERTIES | |
72 VERSION ${PLUGIN_VERSION} | |
73 SOVERSION ${PLUGIN_VERSION} | |
74 ) | |
75 | |
76 target_link_libraries(OrthancAzureBlobStorage | |
77 PRIVATE | |
78 cryptopp-static | |
79 ${WASTORAGE_LIBRARY} ${UUID_LIBRARY} ${Boost_LIBRARIES} ${LIBXML2_LIBRARIES} cpprestsdk::cpprest | |
80 ) | |
81 | |
82 | |
83 | |
84 add_executable(UnitTests | |
85 ${GOOGLE_TEST_SOURCES} | |
86 ${COMMON_SOURCES} | |
87 | |
88 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/EncryptionTests.cpp | |
89 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/UnitTestsMain.cpp | |
90 ) | |
91 | |
92 target_link_libraries(UnitTests | |
93 PRIVATE | |
94 cryptopp-static | |
95 ${GOOGLE_TEST_LIBRARIES} | |
96 ${WASTORAGE_LIBRARY} ${UUID_LIBRARY} ${Boost_LIBRARIES} ${LIBXML2_LIBRARIES} cpprestsdk::cpprest | |
97 ) |