CMAKE_GENERATOR_TOOLSET
Native build system toolset specification provided by user.
Some CMake generators support a toolset specification to tell the native build system how to choose a compiler. If the user specifies a toolset (e.g. via the cmake(1) -T option) the value will be available in this variable.
The value of this variable should never be modified by project code. A toolchain file specified by the CMAKE_TOOLCHAIN_FILE variable may initialize CMAKE_GENERATOR_TOOLSET. Once a given build tree has been initialized with a particular value for this variable, changing the value has undefined behavior.
Toolset specification is supported only on specific generators:
- Visual Studio Generators for VS 2010 and above
- The
Xcodegenerator for Xcode 3.0 and above - The
Green Hills MULTIgenerator
See native build system documentation for allowed toolset names.
Visual Studio Toolset Selection
The Visual Studio Generators support toolset specification using one of these forms:
toolsettoolset[,key=value]*key=value[,key=value]*
The toolset specifies the toolset name. The selected toolset name is provided in the CMAKE_VS_PLATFORM_TOOLSET variable.
The key=value pairs form a comma-separated list of options to specify generator-specific details of the toolset selection. Supported pairs are:
-
cuda=<version> - Specify the CUDA toolkit version to use. Supported by VS 2010 and above with the CUDA toolkit VS integration installed. See the
CMAKE_VS_PLATFORM_TOOLSET_CUDAvariable. -
host=x64 - Request use of the native
x64toolchain onx64hosts. Supported by VS 2013 and above. See theCMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTUREvariable. -
version=<version> - Specify the toolset version to use. Supported by VS 2017 and above with the specified toolset installed. See the
CMAKE_VS_PLATFORM_TOOLSET_VERSIONvariable.
© 2000–2019 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/v3.13/variable/CMAKE_GENERATOR_TOOLSET.html