2019-09-25 01:21:12 +03:00
|
|
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2019-07-31 01:43:32 +03:00
|
|
|
cmake_minimum_required (VERSION 3.12)
|
2019-10-10 03:27:16 +03:00
|
|
|
|
2019-12-14 09:10:47 +03:00
|
|
|
option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" ON)
|
2020-02-20 02:56:10 +03:00
|
|
|
option(BUILD_CURL_TRANSPORT "Build internal http transport implementation with CURL for HTTP Pipeline" OFF)
|
2019-12-14 09:10:47 +03:00
|
|
|
|
2019-10-10 03:27:16 +03:00
|
|
|
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
|
|
|
|
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
|
|
|
|
CACHE STRING "")
|
|
|
|
elseif(DEFINED ENV{VCPKG_INSTALLATION_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
|
|
|
|
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake"
|
|
|
|
CACHE STRING "")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(DEFINED ENV{VCPKG_DEFAULT_TRIPLET} AND NOT DEFINED VCPKG_TARGET_TRIPLET)
|
|
|
|
set(VCPKG_TARGET_TRIPLET "$ENV{VCPKG_DEFAULT_TRIPLET}" CACHE STRING "")
|
|
|
|
endif()
|
|
|
|
|
2019-09-20 21:40:56 +03:00
|
|
|
project(az LANGUAGES C)
|
2019-09-25 01:21:12 +03:00
|
|
|
enable_testing ()
|
2020-01-17 03:47:19 +03:00
|
|
|
|
|
|
|
include(eng/cmake/global_compile_options.txt)
|
|
|
|
|
2019-09-20 21:40:56 +03:00
|
|
|
add_subdirectory(sdk/core/core)
|
2020-02-20 02:56:10 +03:00
|
|
|
# Adding trasnport implementation for curl
|
|
|
|
# Users can still build Core and SDK client without depending on a HTPP transport implementation
|
|
|
|
if(BUILD_CURL_TRANSPORT)
|
|
|
|
add_subdirectory(sdk/transport_policies/curl)
|
|
|
|
endif()
|
|
|
|
|
2019-11-06 03:31:58 +03:00
|
|
|
add_subdirectory(sdk/keyvault/keyvault)
|
2020-01-07 21:34:09 +03:00
|
|
|
add_subdirectory(sdk/storage/blobs)
|
2020-02-13 22:42:12 +03:00
|
|
|
|
|
|
|
if(NOT DEFINED ENV{AZ_SDK_C_NO_SAMPLES})
|
2020-02-20 02:56:10 +03:00
|
|
|
# current samples require an HTTP transport implementation.
|
|
|
|
# disable adding samples if building CURL transport is disabled
|
|
|
|
# Remove this condition if implementing another http transport and link that with samples
|
|
|
|
if(BUILD_CURL_TRANSPORT)
|
2020-02-13 22:42:12 +03:00
|
|
|
add_subdirectory(sdk/keyvault/keyvault/samples)
|
|
|
|
add_subdirectory(sdk/storage/blobs/samples)
|
2020-02-20 02:56:10 +03:00
|
|
|
endif()
|
2020-02-13 22:42:12 +03:00
|
|
|
endif()
|