-
Notifications
You must be signed in to change notification settings - Fork 154
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
133 lines (113 loc) · 4.29 KB
/
CMakeLists.txt
File metadata and controls
133 lines (113 loc) · 4.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake-modules")
include(AzureVcpkg)
az_vcpkg_integrate()
cmake_minimum_required (VERSION 3.13)
project(azure-storage-common LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
option(FETCH_SOURCE_DEPS "build source dependencies" OFF)
include(AzureVersion)
include(AzureCodeCoverage)
include(AzureTransportAdapters)
include(AzureDoxygen)
include(AzureGlobalCompileOptions)
include(AzureConfigRTTI)
include(AzureBuildTargetForCI)
include(CreateMapFile)
if(FETCH_SOURCE_DEPS)
set(AZ_ALL_LIBRARIES ON)
include(FolderList)
SetCompileOptions(STORAGE_COMMON)
GetFolderList(STORAGE_COMMON)
foreach(oneFolder IN LISTS BUILD_FOLDERS)
message("add folder ${oneFolder}")
add_subdirectory(${oneFolder} EXCLUDE_FROM_ALL)
endforeach()
elseif(NOT AZ_ALL_LIBRARIES)
find_package(azure-core-cpp CONFIG QUIET)
if(NOT azure-core-cpp_FOUND)
find_package(azure-core-cpp REQUIRED)
endif()
endif()
find_package(Threads REQUIRED)
set(
AZURE_STORAGE_COMMON_HEADER
inc/azure/storage/common/access_conditions.hpp
inc/azure/storage/common/account_sas_builder.hpp
inc/azure/storage/common/crypt.hpp
inc/azure/storage/common/dll_import_export.hpp
inc/azure/storage/common/internal/concurrent_transfer.hpp
inc/azure/storage/common/internal/constants.hpp
inc/azure/storage/common/internal/file_io.hpp
inc/azure/storage/common/internal/reliable_stream.hpp
inc/azure/storage/common/internal/shared_key_policy.hpp
inc/azure/storage/common/internal/storage_bearer_token_auth.hpp
inc/azure/storage/common/internal/storage_bearer_token_authentication_policy.hpp
inc/azure/storage/common/internal/storage_per_retry_policy.hpp
inc/azure/storage/common/internal/storage_retry_policy.hpp
inc/azure/storage/common/internal/storage_service_version_policy.hpp
inc/azure/storage/common/internal/storage_switch_to_secondary_policy.hpp
inc/azure/storage/common/internal/xml_wrapper.hpp
inc/azure/storage/common/rtti.hpp
inc/azure/storage/common/storage_common.hpp
inc/azure/storage/common/storage_credential.hpp
inc/azure/storage/common/storage_exception.hpp
)
set(
AZURE_STORAGE_COMMON_SOURCE
src/account_sas_builder.cpp
src/crypt.cpp
src/file_io.cpp
src/private/package_version.hpp
src/reliable_stream.cpp
src/shared_key_policy.cpp
src/storage_bearer_token_authentication_policy.cpp
src/storage_credential.cpp
src/storage_exception.cpp
src/storage_per_retry_policy.cpp
src/storage_retry_policy.cpp
src/storage_switch_to_secondary_policy.cpp
src/xml_wrapper.cpp
)
add_library(azure-storage-common ${AZURE_STORAGE_COMMON_HEADER} ${AZURE_STORAGE_COMMON_SOURCE})
create_per_service_target_build(storage azure-storage-common)
# make sure that users can consume the project as a library.
add_library(Azure::azure-storage-common ALIAS azure-storage-common)
target_include_directories(
azure-storage-common
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(azure-storage-common PUBLIC Azure::azure-core)
if(WIN32)
target_link_libraries(azure-storage-common PRIVATE bcrypt webservices)
else()
find_package(LibXml2 REQUIRED)
target_include_directories(azure-storage-common SYSTEM PRIVATE ${LIBXML2_INCLUDE_DIRS})
target_link_libraries(azure-storage-common PRIVATE ${LIBXML2_LIBRARIES})
find_package(OpenSSL REQUIRED)
target_link_libraries(azure-storage-common PRIVATE OpenSSL::SSL OpenSSL::Crypto)
endif()
get_az_version("${CMAKE_CURRENT_SOURCE_DIR}/src/private/package_version.hpp")
generate_documentation(azure-storage-common ${AZ_LIBRARY_VERSION})
az_vcpkg_export(
azure-storage-common
STORAGE_COMMON
"azure/storage/common/dll_import_export.hpp"
)
az_rtti_setup(
azure-storage-common
STORAGE_COMMON
"azure/storage/common/rtti.hpp"
)
# coverage. Has no effect if BUILD_CODE_COVERAGE is OFF
# excluding json from coverage report
create_code_coverage(storage azure-storage-common azure-storage-test "tests?/*;samples?/*")
if(BUILD_TESTING)
add_subdirectory(test/ut)
endif()
unset(FETCH_SOURCE_DEPS CACHE)