1
|
1 cmake_minimum_required(VERSION 2.8)
|
|
2
|
|
3 project(OrthancGoogleCloudStorage)
|
|
4
|
3
|
5 set(PLUGIN_VERSION "0.9.0")
|
1
|
6
|
|
7 include(CheckIncludeFileCXX)
|
|
8
|
|
9 set(ORTHANC_FRAMEWORK_SOURCE "hg" CACHE STRING "orthanc source")
|
|
10 set(ORTHANC_FRAMEWORK_VERSION "1.7.0" CACHE STRING "orthanc framework version")
|
|
11 set(ALLOW_DOWNLOADS ON)
|
|
12
|
|
13 # Download and setup the Orthanc framework
|
|
14 include(${CMAKE_SOURCE_DIR}/../Common/Resources/DownloadOrthancFramework.cmake)
|
|
15
|
|
16 include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake)
|
|
17
|
|
18 set(ENABLE_GOOGLE_TEST ON)
|
|
19 set(ORTHANC_FRAMEWORK_PLUGIN ON)
|
|
20
|
|
21 include(${ORTHANC_ROOT}/Resources/CMake/OrthancFrameworkConfiguration.cmake)
|
|
22
|
|
23
|
|
24 add_definitions(
|
|
25 -DHAS_ORTHANC_EXCEPTION=1
|
|
26 -DORTHANC_ENABLE_LOGGING_PLUGIN=1
|
|
27 -DGOOGLE_STORAGE_PLUGIN=1
|
|
28 )
|
|
29 add_definitions(-DPLUGIN_VERSION="${PLUGIN_VERSION}")
|
|
30
|
|
31 include_directories(
|
|
32 ${ORTHANC_ROOT}
|
|
33 ${ORTHANC_ROOT}/Core
|
|
34 ${ORTHANC_ROOT}/Plugins/Include
|
|
35 ${ORTHANC_ROOT}/Plugins/Samples/Common
|
|
36 )
|
|
37
|
|
38 find_package(CURL REQUIRED)
|
|
39 find_package(storage_client REQUIRED)
|
|
40 find_package(cryptopp CONFIG REQUIRED)
|
|
41
|
|
42 set(COMMON_SOURCES
|
|
43 ${CMAKE_SOURCE_DIR}/../Common/IStoragePlugin.h
|
|
44 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.cpp
|
|
45 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.h
|
|
46 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.cpp
|
|
47 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.h
|
|
48 ${ORTHANC_ROOT}/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
|
|
49
|
|
50 ${ORTHANC_CORE_SOURCES}
|
|
51 )
|
|
52
|
|
53 add_library(OrthancGoogleCloudStorage SHARED
|
|
54 GoogleStoragePlugin.cpp
|
|
55 GoogleStoragePlugin.h
|
|
56 ${CMAKE_SOURCE_DIR}/../Common/StoragePlugin.cpp
|
|
57
|
|
58 ${COMMON_SOURCES}
|
|
59 )
|
|
60
|
|
61 set_target_properties(OrthancGoogleCloudStorage PROPERTIES
|
|
62 VERSION ${PLUGIN_VERSION}
|
|
63 SOVERSION ${PLUGIN_VERSION}
|
|
64 )
|
|
65
|
|
66 target_link_libraries(OrthancGoogleCloudStorage
|
|
67 PRIVATE
|
|
68 storage_client
|
|
69 cryptopp-static
|
|
70 )
|
|
71
|
|
72 add_executable(UnitTests
|
|
73 ${GOOGLE_TEST_SOURCES}
|
|
74 ${COMMON_SOURCES}
|
|
75
|
|
76 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/EncryptionTests.cpp
|
|
77 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/UnitTestsMain.cpp
|
|
78 ${CMAKE_SOURCE_DIR}/../UnitTestsSources/UnitTestsGcsClient.cpp
|
|
79 )
|
|
80
|
|
81 target_link_libraries(UnitTests
|
|
82 PRIVATE
|
|
83 cryptopp-static
|
|
84 storage_client
|
|
85 ${GOOGLE_TEST_LIBRARIES}
|
|
86 )
|