-
Notifications
You must be signed in to change notification settings - Fork 17
/
CMakeLists.txt
59 lines (49 loc) · 1.85 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 2.8.12)
# Set extension name here
set(TARGET_NAME azure)
set(EXTENSION_NAME ${TARGET_NAME}_extension)
project(${TARGET_NAME})
include_directories(src/include)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(EXTENSION_SOURCES
src/azure_extension.cpp
src/azure_secret.cpp
src/azure_filesystem.cpp
src/azure_http_state.cpp
src/azure_storage_account_client.cpp
src/azure_blob_filesystem.cpp
src/azure_dfs_filesystem.cpp
src/http_state_policy.cpp
src/azure_parsed_url.cpp)
add_library(${EXTENSION_NAME} STATIC ${EXTENSION_SOURCES})
set(PARAMETERS "-warnings")
build_loadable_extension(${TARGET_NAME} ${PARAMETERS} ${EXTENSION_SOURCES})
find_package(azure-identity-cpp CONFIG)
find_package(azure-storage-blobs-cpp CONFIG)
find_package(azure-storage-files-datalake-cpp CONFIG)
if(NOT ${azure-identity-cpp_FOUND}
OR NOT ${azure-storage-blobs-cpp_FOUND}
OR NOT ${azure-storage-files-datalake-cpp_FOUND})
message(FATAL_ERROR "Azure SDK not found, did you set up vcpkg correctly?")
endif()
# Static lib
target_link_libraries(
${EXTENSION_NAME} Azure::azure-identity Azure::azure-storage-blobs
Azure::azure-storage-files-datalake)
target_include_directories(
${EXTENSION_NAME} PRIVATE Azure::azure-identity Azure::azure-storage-blobs
Azure::azure-storage-files-datalake)
# Loadable binary
target_link_libraries(
${TARGET_NAME}_loadable_extension Azure::azure-identity
Azure::azure-storage-blobs Azure::azure-storage-files-datalake)
target_include_directories(
${TARGET_NAME}_loadable_extension
PRIVATE Azure::azure-identity Azure::azure-storage-blobs
Azure::azure-storage-files-datalake)
install(
TARGETS ${EXTENSION_NAME}
EXPORT "${DUCKDB_EXPORT_SET}"
LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}")