

The following examples show the changes needed to update the CMakeSettings. For projects using CMakePresets.json, see Visual Studio CMakePresets.json configuration changes. This section describes the CMakeSettings.json configuration. Refer to each project to see which file is used.

Samples are shipped with either a CMakePresets.json or CMakeSettings.json configuration file. Visual Studio CMakeSettings.json configuration For example:Īzsphere_target_hardware_definition($/CMakeFiles/AzureSphereRTCoreToolchain.cmake", This function takes two parameters: a list of directories to search and a filename to search for. You can specify the hardware you are targeting by calling the azsphere_target_hardware_definition function to store the value in CMakeLists.txt. If you change the target API set during development, you need to delete the CMake cache before you run CMake again. For example:Īzsphere_configure_api(TARGET_API_SET "6") You must specify the target API set for the build by using the azsphere_configure_api function to store the value in CMakeLists.txt. The azsphere_configure_tools function specifies the minimum SDK version that is required to build your application. For example, the 20.04 release introduced four new CMake functions that were not present in the 20.01 release. For example:Īzsphere_configure_tools(TOOLS_REVISION "20.04")ĭifferent versions of the Azure Sphere tools may offer different CMake features. This call must precede all other function calls. You must specify the Azure Sphere SDK version for your build by calling the azsphere_configure_tools function to store the value in CMakeLists.txt. The CMakeLists.txt file must call the project command before any of the azsphere_ functions. If you have an existing application that was created with an SDK earlier than 20.04, see Convert an existing app to use the CMake functions. Azure Sphere supports the use of the following functions in CMakeLists.txt: Name The CMakeLists.txt file provides the general configuration settings that CMake uses to build an application.
CMAKE COMMANDS FULL
Full path to cpack (1) command installed with CMake. usr/local/bin/cmake) CMAKECPACKCOMMAND New in version 3.13.
CMAKE COMMANDS PORTABLE
This is the full path to the CMake executable cmake (1) which is useful from custom commands that want to use the cmake-E option for portable system commands.
CMAKE COMMANDS WINDOWS
The specific character is determined by the Windows or Linux terminal configuration. The full path to the cmake (1) executable. The line continuation character "^" for the Windows command line, " \ " for the Linux command line, or "`" for Powershell can be used for readability but is not required. Required for building with Visual Studio Code.ĬMake parameters are separated by spaces. Visual Studio configuration file for projects with multiple roots, as in the IntercoreComms sample. Either this file or CMakePresets.json is required for building with Visual Studio. Either this file or CMakeSettings.json is required for building with Visual Studio. Required for all builds.Ĭonfiguration presets file for Visual Studio and Visual Studio Code. CMake Tools extension for Visual Studio CodeĬMake builds use the following files: File.

The following sources provide information about using CMake with Visual Studio or Visual Studio Code: CMake is an open-source, cross-platform make system. Open the generated solution with C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe ROOT.Azure Sphere uses CMake to configure builds for applications with Visual Studio, Visual Studio Code, and the Windows and Linux command lines. Generate the Microsoft Visual Studio solution with cmake -G "Visual Studio 10" /path/to/source/dir. Open the generated file with the Xcode application. For CMake-GUI this step is triggered by clicking on the Configure button. Generate the Xcode project with cmake -G Xcode /path/to/source/dir. Different types of variables will be described further in detail. Generate a Ninja project with cmake -G Ninja /path/to/source/dir. To see the list of available generators do cmake -help. The available generators depend on the platform for which cmake have been build. CMake generatorsĬMake can generate, in addition to standard makefiles, specific projects for various integrated development environments (IDEs) such as Xcode, Eclipse, Visual Studio, etc. It is recommended to delete the file CMakeCache.txt to start from a clean configuration. Variables in the CMake cache are ‘remembered’, so you do not need to type them if you execute cmake command again. $ cmake -DVARIABLE:TYPE=value path/to/source
