New in version 3.1.
Generator-specific target platform specification provided by user.
Some CMake generators support a target platform name to be given
to the native build system to choose a compiler toolchain.
If the user specifies a platform name (e.g. via the
option or via the
CMAKE_GENERATOR_PLATFORM environment variable)
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
variable may initialize
CMAKE_GENERATOR_PLATFORM. Once a given
build tree has been initialized with a particular value for this
variable, changing the value has undefined behavior.
Platform specification is supported only on specific generators:
For Visual Studio Generators with VS 2005 and above this specifies the target architecture.
Green Hills MULTIthis specifies the target architecture.
See native build system documentation for allowed platform names.
Visual Studio Platform Selection¶
The Visual Studio Generators support platform specification using one of these forms:
platform specifies the target platform (VS target architecture),
Win32. The selected platform
name is provided in the
key=value pairs form a comma-separated list of options to
specify generator-specific details of the platform selection.
Supported pairs are:
New in version 3.27.
Specify the Windows SDK version to use. This is supported by VS 2015 and above when targeting Windows or Windows Store. CMake will set the
CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSIONvariable to the selected SDK version.
<version>may be one of:
Specify that any 10.0 SDK version may be used, and let Visual Studio pick one. This is supported by VS 2019 and above.
Specify the exact 4-component SDK version, e.g.,
10.0.19041.0. The specified version of the SDK must be installed. It may not exceed the value of
CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM, if that variable is set.
Specify the 8.1 SDK version. This is always supported by VS 2015. On VS 2017 and above the 8.1 SDK must be installed.
versionfield is not specified, CMake selects a version as described in the