annotate Azure/CMakeLists.txt @ 52:8a1dfd2d790d

back to 'mainline' version
author Alain Mazy <am@osimis.io>
date Mon, 26 Apr 2021 09:42:30 +0200
parents b40327079244
children b922ae86bbe1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
1 cmake_minimum_required(VERSION 2.8)
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
2
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
3 project(OrthancAzureBlobStorage)
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
4
52
8a1dfd2d790d back to 'mainline' version
Alain Mazy <am@osimis.io>
parents: 50
diff changeset
5 set(PLUGIN_VERSION "mainline")
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
6
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
7 include(CheckIncludeFileCXX)
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
8
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
9 set(ORTHANC_FRAMEWORK_SOURCE "hg" CACHE STRING "orthanc source")
49
6db76975d0f8 update to Orthanc Framework 1.9.2
Alain Mazy <am@osimis.io>
parents: 47
diff changeset
10 set(ORTHANC_FRAMEWORK_VERSION "1.9.2" CACHE STRING "orthanc framework version")
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
11 set(ALLOW_DOWNLOADS ON)
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
12
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
13 # Download and setup the Orthanc framework
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
14 include(${CMAKE_SOURCE_DIR}/../Common/Resources/DownloadOrthancFramework.cmake)
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
15
15
2a02b21f0a19 migration + storage structure
Alain Mazy
parents: 8
diff changeset
16 include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkParameters.cmake)
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
17
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
18 set(ENABLE_GOOGLE_TEST ON)
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
19 set(ORTHANC_FRAMEWORK_PLUGIN ON)
22
319d41a22de4 more lightweight use of Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 18
diff changeset
20 set(ENABLE_MODULE_IMAGES OFF)
319d41a22de4 more lightweight use of Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 18
diff changeset
21 set(ENABLE_MODULE_JOBS OFF)
319d41a22de4 more lightweight use of Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 18
diff changeset
22 set(ENABLE_MODULE_DICOM OFF)
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
23
15
2a02b21f0a19 migration + storage structure
Alain Mazy
parents: 8
diff changeset
24 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
25 include(${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common/OrthancPluginsExports.cmake)
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
26
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
27 add_definitions(
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
28 -DHAS_ORTHANC_EXCEPTION=1
15
2a02b21f0a19 migration + storage structure
Alain Mazy
parents: 8
diff changeset
29 -DORTHANC_ENABLE_LOGGING=1
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
30 -DAZURE_STORAGE_PLUGIN=1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
31 )
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
32 add_definitions(-DPLUGIN_VERSION="${PLUGIN_VERSION}")
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
33
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
34 include_directories(
15
2a02b21f0a19 migration + storage structure
Alain Mazy
parents: 8
diff changeset
35 ${ORTHANC_FRAMEWORK_ROOT}
2a02b21f0a19 migration + storage structure
Alain Mazy
parents: 8
diff changeset
36 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Include
2a02b21f0a19 migration + storage structure
Alain Mazy
parents: 8
diff changeset
37 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
38 )
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
39
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
40
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
41 find_package(cryptopp CONFIG REQUIRED)
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
42
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
43 # Azure stuff (from https://github.com/Microsoft/vcpkg/issues/6277)
34
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
44 if (NOT WIN32)
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
45 find_package(cpprestsdk CONFIG REQUIRED)
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
46 find_path(WASTORAGE_INCLUDE_DIR was/blob.h)
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
47 find_library(WASTORAGE_LIBRARY azurestorage)
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
48 find_package(Boost REQUIRED COMPONENTS log)
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
49 find_library(UUID_LIBRARY uuid)
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
50 find_package(LibXml2 REQUIRED)
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
51 else() # inspired from https://github.com/phongcao/azure-storage-cpp-sas-sample/blob/master/CMakeLists.txt
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
52 find_path(WASTORAGE_INCLUDE_DIR was/blob.h)
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
53 find_library(CPPREST_LIBRARY
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
54 NAMES cpprest cpprest_2_10)
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
55 find_library(WASTORAGE_LIBRARY wastorage)
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
56
34
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
57 set (CMAKE_CXX_STANDARD 11)
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
58 set (CMAKE_CXX_STANDARD_REQUIRED ON)
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
59 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa")
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
60 set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
61 set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
62
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
63 add_definitions(-D_NO_WASTORAGE_API=1) # from https://github.com/Azure/azure-storage-cpp/issues/263
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
64 endif()
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
65
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
66
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
67 if (NOT WIN32)
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
68 include_directories(${WASTORAGE_INCLUDE_DIR})
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
69 endif()
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
70
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
71 set(COMMON_SOURCES
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
72 ${CMAKE_SOURCE_DIR}/../Common/IStoragePlugin.h
15
2a02b21f0a19 migration + storage structure
Alain Mazy
parents: 8
diff changeset
73 ${CMAKE_SOURCE_DIR}/../Common/BaseStoragePlugin.h
2a02b21f0a19 migration + storage structure
Alain Mazy
parents: 8
diff changeset
74 ${CMAKE_SOURCE_DIR}/../Common/BaseStoragePlugin.cpp
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
75 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.cpp
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
76 ${CMAKE_SOURCE_DIR}/../Common/EncryptionHelpers.h
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
77 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.cpp
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
78 ${CMAKE_SOURCE_DIR}/../Common/EncryptionConfigurator.h
15
2a02b21f0a19 migration + storage structure
Alain Mazy
parents: 8
diff changeset
79 ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
80
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
81 ${ORTHANC_CORE_SOURCES}
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
82 )
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
83
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
84 add_library(OrthancAzureBlobStorage SHARED
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
85 AzureBlobStoragePlugin.cpp
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
86 AzureBlobStoragePlugin.h
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
87 ${CMAKE_SOURCE_DIR}/../Common/StoragePlugin.cpp
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
88
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
89 ${COMMON_SOURCES}
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
90 )
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
91
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
92 set_target_properties(OrthancAzureBlobStorage PROPERTIES
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
93 VERSION ${PLUGIN_VERSION}
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
94 SOVERSION ${PLUGIN_VERSION}
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
95 )
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
96
34
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
97 if (NOT WIN32)
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
98
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
99 target_link_libraries(OrthancAzureBlobStorage
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
100 PRIVATE
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
101 cryptopp-static
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
102 ${WASTORAGE_LIBRARY}
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
103 ${UUID_LIBRARY}
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
104 ${Boost_LIBRARIES}
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
105 ${LIBXML2_LIBRARIES}
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
106 cpprestsdk::cpprest
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
107 )
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
108 else()
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
109 target_link_libraries(OrthancAzureBlobStorage
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
110 PRIVATE
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
111 cryptopp-static
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
112 ${OPENSSL_LIBRARY}
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
113 ${WASTORAGE_LIBRARY}
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
114 ${CPPREST_LIBRARY}
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
115 Winhttp.lib
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
116 Crypt32.lib
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
117 xmllite.lib
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
118 )
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
119
34
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
120 endif()
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
121
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
122
34
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
123 # add_executable(UnitTests
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
124 # ${GOOGLE_TEST_SOURCES}
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
125 # ${COMMON_SOURCES}
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
126
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
127 # ${CMAKE_SOURCE_DIR}/../UnitTestsSources/EncryptionTests.cpp
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
128 # ${CMAKE_SOURCE_DIR}/../UnitTestsSources/UnitTestsMain.cpp
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
129 # )
1
fc26a8fc54d5 initial release
Alain Mazy <alain@mazy.be>
parents:
diff changeset
130
34
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
131 # target_link_libraries(UnitTests
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
132 # PRIVATE
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
133 # cryptopp-static
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
134 # ${GOOGLE_TEST_LIBRARIES}
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
135 # ${WASTORAGE_LIBRARY}
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
136 # # ${UUID_LIBRARY}
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
137 # # ${Boost_LIBRARIES}
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
138 # # ${LIBXML2_LIBRARIES}
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
139 # cpprestsdk::cpprest
7ddd840563c9 windows build for Azure plugin
Alain Mazy <alain@mazy.be>
parents: 22
diff changeset
140 # )