Mercurial > hg > orthanc-object-storage
comparison Azure/CMakeLists.txt @ 99:f4e05641c108
rewrote using the latest azure C++ sdk
author | Alain Mazy <am@osimis.io> |
---|---|
date | Thu, 20 Jul 2023 15:09:57 +0200 |
parents | 7bf31db5497e |
children | 16f0abc677c5 |
comparison
equal
deleted
inserted
replaced
98:91aeaecf7100 | 99:f4e05641c108 |
---|---|
55 ) | 55 ) |
56 | 56 |
57 find_package(cryptopp CONFIG REQUIRED) | 57 find_package(cryptopp CONFIG REQUIRED) |
58 | 58 |
59 # Azure stuff (from https://github.com/Microsoft/vcpkg/issues/6277) | 59 # Azure stuff (from https://github.com/Microsoft/vcpkg/issues/6277) |
60 if (NOT WIN32) | 60 find_package(azure-storage-blobs-cpp CONFIG REQUIRED) |
61 find_package(cpprestsdk CONFIG REQUIRED) | |
62 find_path(WASTORAGE_INCLUDE_DIR was/blob.h) | |
63 find_library(WASTORAGE_LIBRARY azurestorage) | |
64 find_package(Boost REQUIRED COMPONENTS log) | |
65 find_library(UUID_LIBRARY uuid) | |
66 find_package(LibXml2 REQUIRED) | |
67 else() # inspired from https://github.com/phongcao/azure-storage-cpp-sas-sample/blob/master/CMakeLists.txt | |
68 find_path(WASTORAGE_INCLUDE_DIR was/blob.h) | |
69 find_library(CPPREST_LIBRARY | |
70 NAMES cpprest cpprest_2_10) | |
71 find_library(WASTORAGE_LIBRARY wastorage) | |
72 | 61 |
73 set (CMAKE_CXX_STANDARD 11) | 62 # if (NOT WIN32) |
74 set (CMAKE_CXX_STANDARD_REQUIRED ON) | 63 # find_package(cpprestsdk CONFIG REQUIRED) |
75 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa") | 64 # find_path(WASTORAGE_INCLUDE_DIR was/blob.h) |
76 set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi") | 65 # find_library(WASTORAGE_LIBRARY azurestorage) |
77 set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF") | 66 # find_package(Boost REQUIRED COMPONENTS log) |
67 # find_library(UUID_LIBRARY uuid) | |
68 # find_package(LibXml2 REQUIRED) | |
69 # else() # inspired from https://github.com/phongcao/azure-storage-cpp-sas-sample/blob/master/CMakeLists.txt | |
70 # find_path(WASTORAGE_INCLUDE_DIR was/blob.h) | |
71 # find_library(CPPREST_LIBRARY | |
72 # NAMES cpprest cpprest_2_10) | |
73 # find_library(WASTORAGE_LIBRARY wastorage) | |
78 | 74 |
79 message(INFO "WASTORAGE_INCLUDE_DIR ${WASTORAGE_INCLUDE_DIR}") | 75 # set (CMAKE_CXX_STANDARD 11) |
76 # set (CMAKE_CXX_STANDARD_REQUIRED ON) | |
77 # set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa") | |
78 # set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi") | |
79 # set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF") | |
80 | 80 |
81 add_definitions(-D_NO_WASTORAGE_API=1) # from https://github.com/Azure/azure-storage-cpp/issues/263 | 81 # message(INFO "WASTORAGE_INCLUDE_DIR ${WASTORAGE_INCLUDE_DIR}") |
82 endif() | |
83 | 82 |
84 include_directories(${WASTORAGE_INCLUDE_DIR}) | 83 # add_definitions(-D_NO_WASTORAGE_API=1) # from https://github.com/Azure/azure-storage-cpp/issues/263 |
84 # endif() | |
85 | 85 |
86 # include_directories(${WASTORAGE_INCLUDE_DIR}) | |
87 set (CMAKE_CXX_STANDARD 14) | |
86 | 88 |
87 set(COMMON_SOURCES | 89 set(COMMON_SOURCES |
88 ${CMAKE_SOURCE_DIR}/../Common/IStorage.h | 90 ${CMAKE_SOURCE_DIR}/../Common/IStorage.h |
89 ${CMAKE_SOURCE_DIR}/../Common/BaseStorage.h | 91 ${CMAKE_SOURCE_DIR}/../Common/BaseStorage.h |
90 ${CMAKE_SOURCE_DIR}/../Common/BaseStorage.cpp | 92 ${CMAKE_SOURCE_DIR}/../Common/BaseStorage.cpp |
121 cryptopp::cryptopp | 123 cryptopp::cryptopp |
122 ${WASTORAGE_LIBRARY} | 124 ${WASTORAGE_LIBRARY} |
123 ${UUID_LIBRARY} | 125 ${UUID_LIBRARY} |
124 ${Boost_LIBRARIES} | 126 ${Boost_LIBRARIES} |
125 ${LIBXML2_LIBRARIES} | 127 ${LIBXML2_LIBRARIES} |
126 cpprestsdk::cpprest | 128 Azure::azure-storage-blobs |
127 ) | 129 ) |
128 else() | 130 else() |
129 target_link_libraries(OrthancAzureBlobStorage | 131 target_link_libraries(OrthancAzureBlobStorage |
130 PRIVATE | 132 PRIVATE |
131 cryptopp::cryptopp | 133 Azure::azure-storage-blobs |
132 ${OPENSSL_LIBRARY} | 134 ${OPENSSL_LIBRARY} |
133 ${WASTORAGE_LIBRARY} | 135 ${WASTORAGE_LIBRARY} |
134 ${CPPREST_LIBRARY} | 136 ${CPPREST_LIBRARY} |
135 Winhttp.lib | 137 Winhttp.lib |
136 Crypt32.lib | 138 Crypt32.lib |