Mercurial > hg > orthanc-object-storage
comparison Aws/CMakeLists.txt @ 1:fc26a8fc54d5
initial release
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Fri, 03 Jul 2020 10:08:44 +0200 |
parents | |
children | cd1622edea7f |
comparison
equal
deleted
inserted
replaced
0:d7198e8f0d47 | 1:fc26a8fc54d5 |
---|---|
1 cmake_minimum_required(VERSION 2.8) | |
2 | |
3 option(BUILD_SHARED_LIBS "Build shared libraries" ON) | |
4 | |
5 project(OrthancAwsS3Storage) | |
6 | |
7 set(PLUGIN_VERSION "0.9") | |
8 | |
9 include(CheckIncludeFileCXX) | |
10 | |
11 set(ORTHANC_FRAMEWORK_SOURCE "hg" CACHE STRING "orthanc source") | |
12 set(ORTHANC_FRAMEWORK_VERSION "1.7.0" CACHE STRING "orthanc framework version") | |
13 set(ALLOW_DOWNLOADS ON) | |
14 | |
15 # Download and setup the Orthanc framework | |
16 include(${CMAKE_SOURCE_DIR}/../Common/Resources/DownloadOrthancFramework.cmake) | |
17 | |
18 include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) | |
19 | |
20 set(ENABLE_GOOGLE_TEST ON) | |
21 set(ORTHANC_FRAMEWORK_PLUGIN ON) | |
22 | |
23 include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake) | |
24 | |
25 | |
26 add_definitions( | |
27 -DHAS_ORTHANC_EXCEPTION=1 | |
28 -DORTHANC_ENABLE_LOGGING_PLUGIN=1 | |
29 -DAWS_STORAGE_PLUGIN=1 | |
30 ) | |
31 add_definitions(-DPLUGIN_VERSION="${PLUGIN_VERSION}") | |
32 | |
33 include_directories( | |
34 ${ORTHANC_ROOT} | |
35 ${ORTHANC_ROOT}/Core | |
36 ${ORTHANC_ROOT}/Plugins/Include | |
37 ${ORTHANC_ROOT}/Plugins/Samples/Common | |
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 | |
48 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.cpp | |
49 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.h | |
50 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.cpp | |
51 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.h | |
52 ${ORTHANC_ROOT}/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp | |
53 | |
54 ${ORTHANC_CORE_SOURCES} | |
55 ) | |
56 | |
57 add_library(OrthancAwsS3Storage SHARED | |
58 AwsS3StoragePlugin.cpp | |
59 AwsS3StoragePlugin.h | |
60 ${CMAKE_SOURCE_DIR}/../Common/StoragePlugin.cpp | |
61 | |
62 ${COMMON_SOURCES} | |
63 ) | |
64 | |
65 set_target_properties(OrthancAwsS3Storage PROPERTIES | |
66 VERSION ${PLUGIN_VERSION} | |
67 SOVERSION ${PLUGIN_VERSION} | |
68 ) | |
69 | |
70 target_link_libraries(OrthancAwsS3Storage | |
71 PRIVATE | |
72 cryptopp-static | |
73 ${AWSSDK_LINK_LIBRARIES} | |
74 ) | |
75 | |
76 | |
77 | |
78 add_executable(UnitTests | |
79 ${GOOGLE_TEST_SOURCES} | |
80 ${COMMON_SOURCES} | |
81 | |
82 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/EncryptionTests.cpp | |
83 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/UnitTestsMain.cpp | |
84 ) | |
85 | |
86 target_link_libraries(UnitTests | |
87 PRIVATE | |
88 cryptopp-static | |
89 ${GOOGLE_TEST_LIBRARIES} | |
90 ${AWSSDK_LINK_LIBRARIES} | |
91 ) |