-
Notifications
You must be signed in to change notification settings - Fork 120
/
AddAzureSDKforC.cmake
25 lines (24 loc) · 1.21 KB
/
AddAzureSDKforC.cmake
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
# Copyright (c) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: MIT
#
# How to use: Copy this file to a cmake modules folder within your project.
# - Add `list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/your-cmake-modules-folder")`
# - Call this module by doing `include(AddAzureSDKforC)` from the root CMakeLists.txt.
# - Link your application against your CMake targets, for example, `target_link_libraries(yourApp PRIVATE az_core)`.
#
# This will create a _deps folder for the generated project and Azure SDK will be checked out in there.
# When calling `cmake --build .`, Azure SDK will be built before your application so it can be available for your app to consume.
#
# CMake options for Azure SDK for C can be set together with your application CMake options.
#
# Note: Update GIT_TAG to the expected version from Azure SDK for C
#
include(FetchContent)
FetchContent_Declare(azuresdkforc
GIT_REPOSITORY https://github.com/Azure/azure-sdk-for-c.git
GIT_TAG 1.5.0)
FetchContent_GetProperties(azuresdkforc)
if(NOT azuresdkforc_POPULATED)
FetchContent_Populate(azuresdkforc)
add_subdirectory(${azuresdkforc_SOURCE_DIR} ${azuresdkforc_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()