Mercurial > hg > orthanc-object-storage
annotate Aws/CMakeLists.txt @ 18:44de9edf2443
fix compilation to avoid exposing internal symbols which caused a crash at Orthanc startup
author | Alain Mazy |
---|---|
date | Wed, 02 Sep 2020 18:15:45 +0200 |
parents | 2a02b21f0a19 |
children | b77be39e25a5 e568ca940ddd 319d41a22de4 |
rev | line source |
---|---|
1 | 1 cmake_minimum_required(VERSION 2.8) |
2 | |
3 option(BUILD_SHARED_LIBS "Build shared libraries" ON) | |
4 | |
5 project(OrthancAwsS3Storage) | |
6 | |
2 | 7 set(PLUGIN_VERSION "mainline") |
1 | 8 |
9 include(CheckIncludeFileCXX) | |
10 | |
11 set(ORTHANC_FRAMEWORK_SOURCE "hg" CACHE STRING "orthanc source") | |
15 | 12 set(ORTHANC_FRAMEWORK_VERSION "1.7.3" CACHE STRING "orthanc framework version") |
1 | 13 set(ALLOW_DOWNLOADS ON) |
14 | |
15 # Download and setup the Orthanc framework | |
16 include(${CMAKE_SOURCE_DIR}/../Common/Resources/DownloadOrthancFramework.cmake) | |
17 | |
15 | 18 include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkParameters.cmake) |
1 | 19 |
20 set(ENABLE_GOOGLE_TEST ON) | |
21 set(ORTHANC_FRAMEWORK_PLUGIN ON) | |
22 | |
15 | 23 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
|
24 include(${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common/OrthancPluginsExports.cmake) |
1 | 25 |
26 | |
27 add_definitions( | |
28 -DHAS_ORTHANC_EXCEPTION=1 | |
15 | 29 -DORTHANC_ENABLE_LOGGING=1 |
1 | 30 -DAWS_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 find_package(AWSSDK REQUIRED COMPONENTS s3) | |
43 | |
44 include_directories(${WASTORAGE_INCLUDE_DIR}) | |
45 | |
46 set(COMMON_SOURCES | |
47 ${CMAKE_SOURCE_DIR}/../Common/IStoragePlugin.h | |
15 | 48 ${CMAKE_SOURCE_DIR}/../Common/BaseStoragePlugin.h |
49 ${CMAKE_SOURCE_DIR}/../Common/BaseStoragePlugin.cpp | |
1 | 50 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.cpp |
51 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.h | |
52 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.cpp | |
53 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.h | |
15 | 54 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp |
1 | 55 |
56 ${ORTHANC_CORE_SOURCES} | |
57 ) | |
58 | |
59 add_library(OrthancAwsS3Storage SHARED | |
60 AwsS3StoragePlugin.cpp | |
61 AwsS3StoragePlugin.h | |
62 ${CMAKE_SOURCE_DIR}/../Common/StoragePlugin.cpp | |
63 | |
64 ${COMMON_SOURCES} | |
65 ) | |
66 | |
67 set_target_properties(OrthancAwsS3Storage PROPERTIES | |
68 VERSION ${PLUGIN_VERSION} | |
69 SOVERSION ${PLUGIN_VERSION} | |
70 ) | |
71 | |
72 target_link_libraries(OrthancAwsS3Storage | |
73 PRIVATE | |
74 cryptopp-static | |
75 ${AWSSDK_LINK_LIBRARIES} | |
76 ) | |
77 | |
78 | |
79 | |
80 add_executable(UnitTests | |
81 ${GOOGLE_TEST_SOURCES} | |
82 ${COMMON_SOURCES} | |
83 | |
84 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/EncryptionTests.cpp | |
85 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/UnitTestsMain.cpp | |
86 ) | |
87 | |
88 target_link_libraries(UnitTests | |
89 PRIVATE | |
90 cryptopp-static | |
91 ${GOOGLE_TEST_LIBRARIES} | |
92 ${AWSSDK_LINK_LIBRARIES} | |
93 ) |