2020-02-20 23:10:01 +03:00
|
|
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
cmake_minimum_required (VERSION 3.12)
|
2020-03-18 20:58:28 +03:00
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake-modules")
|
2020-02-20 23:10:01 +03:00
|
|
|
|
2020-03-18 20:58:28 +03:00
|
|
|
# Compile Options
|
2020-02-20 23:10:01 +03:00
|
|
|
option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" ON)
|
|
|
|
option(BUILD_CURL_TRANSPORT "Build internal http transport implementation with CURL for HTTP Pipeline" OFF)
|
2020-03-26 21:38:07 +03:00
|
|
|
option(BUILD_TESTING "Build test cases" OFF)
|
2020-02-20 23:10:01 +03:00
|
|
|
|
2020-03-18 20:58:28 +03:00
|
|
|
# VCPKG Integration
|
2020-02-20 23:10:01 +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()
|
|
|
|
|
2020-03-18 20:58:28 +03:00
|
|
|
# Project definition
|
2020-02-20 23:10:01 +03:00
|
|
|
project(az LANGUAGES CXX)
|
2020-03-26 21:38:07 +03:00
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
2020-02-20 23:10:01 +03:00
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
|
|
|
|
2020-03-26 21:38:07 +03:00
|
|
|
if(BUILD_TESTING)
|
|
|
|
# tests
|
|
|
|
enable_testing ()
|
|
|
|
add_subdirectory(sdk/core/azure-core/test)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# compiler warning flags globally
|
2020-03-18 20:58:28 +03:00
|
|
|
include(global_compile_options)
|
|
|
|
|
|
|
|
# sub-projects
|
|
|
|
add_subdirectory(sdk/core/azure-core)
|
2020-04-02 21:05:26 +03:00
|
|
|
add_subdirectory(sdk/platform/http_client/curl) # will work only if BUILD_CURL_TRANSPORT=ON
|
|
|
|
add_subdirectory(sdk/samples/http_client/curl) # will work only if BUILD_CURL_TRANSPORT=ON
|
|
|
|
add_subdirectory(sdk/platform/http_client/nohttp) # will work only if !BUILD_CURL_TRANSPORT=ON
|