azure-sdk-for-cpp/CMakeLists.txt
Daniel Jurek 919610f429
Use version.hpp for package versions (#572)
* Add version.txt
* Add doc generation for template
* Add version.hpp parsing and update capabilities to cmake and engsys
* Get-SdkVersion -> Get-PkgVersion
* Move Update-PkgVersion.ps1 under eng/scripts
* Get-PackageVersion -> Get-PkgVersion
* Update paths, params, verbosity
* Couple fixes to output and make use of new SemVer version
* Add fallback support for verison.txt in cases where we still use it to unblock release artifact generation
* Use version information in release pipeline
* Add workaround to generate storage pipeline artifacts
* eng/scripts/
* Write warning
* Haven't released storage-file-shares yet according to releases on GitHub
* Set release date on changelog.md
* Update CHANGELOG.md to indicate this is a test release
* Remove fallback exception for storage
* Re-add Rick's suggestions
* Revert "Remove fallback exception for storage"
2020-09-02 18:53:46 -07:00

66 lines
2.3 KiB
CMake

# Copyright (c) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: MIT
cmake_minimum_required (VERSION 3.15)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules")
# Compile Options
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)
option(BUILD_TESTING "Build test cases" OFF)
option(BUILD_DOCUMENTATION "Create HTML based API documentation (requires Doxygen)" OFF)
option(RUN_LONG_UNIT_TESTS "Tests that takes more than 5 minutes to complete. No effect if BUILD_TESTING is OFF" OFF)
if(BUILD_TESTING)
# define a symbol that enables some test hooks in code
add_compile_definitions(TESTING_BUILD)
if(RUN_LONG_UNIT_TESTS)
add_compile_definitions(RUN_LONG_UNIT_TESTS)
endif()
endif()
# VCPKG Integration
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()
# Define WINDOWS of POSIX for specific code implementations like FileStream
include(DefinePlatform)
# Project definition
project(az LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
if(BUILD_TESTING)
# tests
include(AddGoogleTest)
enable_testing ()
add_subdirectory(sdk/core/azure-core/test/ut)
endif()
# compiler warning flags globally
include(global_compile_options)
# Documentation automation function
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules/doxygen_common.cmake)
# Functions for library versions
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules/az_version.cmake)
# sub-projects
add_subdirectory(sdk/core/performance-stress)
add_subdirectory(sdk/core/azure-core)
if(BUILD_CURL_TRANSPORT)
add_subdirectory(sdk/core/azure-core/test/e2e) # will work only if BUILD_CURL_TRANSPORT=ON
endif()
add_subdirectory(sdk/storage)
add_subdirectory(sdk/template/azure-template)