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)
|
1
|
24
|
|
25
|
|
26 add_definitions(
|
|
27 -DHAS_ORTHANC_EXCEPTION=1
|
15
|
28 -DORTHANC_ENABLE_LOGGING=1
|
1
|
29 -DAWS_STORAGE_PLUGIN=1
|
|
30 )
|
|
31 add_definitions(-DPLUGIN_VERSION="${PLUGIN_VERSION}")
|
|
32
|
|
33 include_directories(
|
15
|
34 ${ORTHANC_FRAMEWORK_ROOT}
|
|
35 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Include
|
|
36 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common
|
1
|
37 )
|
|
38
|
|
39
|
|
40 find_package(cryptopp CONFIG REQUIRED)
|
|
41 find_package(AWSSDK REQUIRED COMPONENTS s3)
|
|
42
|
|
43 include_directories(${WASTORAGE_INCLUDE_DIR})
|
|
44
|
|
45 set(COMMON_SOURCES
|
|
46 ${CMAKE_SOURCE_DIR}/../Common/IStoragePlugin.h
|
15
|
47 ${CMAKE_SOURCE_DIR}/../Common/BaseStoragePlugin.h
|
|
48 ${CMAKE_SOURCE_DIR}/../Common/BaseStoragePlugin.cpp
|
1
|
49 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.cpp
|
|
50 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.h
|
|
51 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.cpp
|
|
52 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.h
|
15
|
53 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
|
1
|
54
|
|
55 ${ORTHANC_CORE_SOURCES}
|
|
56 )
|
|
57
|
|
58 add_library(OrthancAwsS3Storage SHARED
|
|
59 AwsS3StoragePlugin.cpp
|
|
60 AwsS3StoragePlugin.h
|
|
61 ${CMAKE_SOURCE_DIR}/../Common/StoragePlugin.cpp
|
|
62
|
|
63 ${COMMON_SOURCES}
|
|
64 )
|
|
65
|
|
66 set_target_properties(OrthancAwsS3Storage PROPERTIES
|
|
67 VERSION ${PLUGIN_VERSION}
|
|
68 SOVERSION ${PLUGIN_VERSION}
|
|
69 )
|
|
70
|
|
71 target_link_libraries(OrthancAwsS3Storage
|
|
72 PRIVATE
|
|
73 cryptopp-static
|
|
74 ${AWSSDK_LINK_LIBRARIES}
|
|
75 )
|
|
76
|
|
77
|
|
78
|
|
79 add_executable(UnitTests
|
|
80 ${GOOGLE_TEST_SOURCES}
|
|
81 ${COMMON_SOURCES}
|
|
82
|
|
83 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/EncryptionTests.cpp
|
|
84 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/UnitTestsMain.cpp
|
|
85 )
|
|
86
|
|
87 target_link_libraries(UnitTests
|
|
88 PRIVATE
|
|
89 cryptopp-static
|
|
90 ${GOOGLE_TEST_LIBRARIES}
|
|
91 ${AWSSDK_LINK_LIBRARIES}
|
|
92 )
|