azure-sdk-for-cpp/samples/integration/cmake-fetch-content
Larry Osterman b303a70eaa
Stop disabling security warnings in get_env.hpp; Fixed all incorrect … (#4655)
* Disable deprecation warnings in cmakelists.txt to avoid introducing new concepts; removed unnecessary uses of get_env.hpp

* Removed use of GetEnvHelper from AMQP samples

* Removed special case for get_env.hpp
2023-06-01 12:50:45 -07:00
..
src Stop disabling security warnings in get_env.hpp; Fixed all incorrect … (#4655) 2023-06-01 12:50:45 -07:00
CMakeLists.txt Encapsulate getenv(), and make it work on UWP (#3275) 2022-01-29 08:22:33 +00:00
LICENSE Sample for fetchContent (#1392) 2021-01-22 16:10:44 -08:00
README.md Update links from master to main (#2488) 2021-06-24 22:27:14 -07:00

Integrating the Azure SDK for C++ into your application using CMake fetch content

This application shows how to integrate the Azure SDK for C++ in your application. It uses CMake fetch content functionality to clone the Azure SDK for C++ repo into your build directory. This approach is useful when using CMake to build your application.

Pre-requisites

Install the Azure SDK for C++ dependencies.

  • CMake project (min version 3.13).
  • C++ version 14 or greater.

Build

#
# Building the application.
# Instructions from application root directory.
#

# Create build directory just the first time.
mkdir build
cd build

# Generate and build
# This code assumes that the SDK dependencies were installed with vcpkg
cmake -DCMAKE_TOOLCHAIN_FILE=path/to/vcpkg/scripts/buildsystems/vcpkg.cmake ..
cmake -build .

Run application

Review source code header for environment variables that must be set up before running the app.

#
# Running the Application
# Instructions from inside the build directory.
#

# Run binary (.exe on Windows)
./application