cmake/Help/variable/CMAKE_GENERATOR_PLATFORM.rst

34 lines
1.3 KiB
ReStructuredText
Raw Normal View History

2015-04-27 22:25:09 +02:00
CMAKE_GENERATOR_PLATFORM
------------------------
2021-09-14 00:13:48 +02:00
.. versionadded:: 3.1
2017-07-20 19:35:53 +02:00
Generator-specific target platform specification provided by user.
2015-04-27 22:25:09 +02:00
Some CMake generators support a target platform name to be given
to the native build system to choose a compiler toolchain.
2022-11-16 20:14:03 +01:00
If the user specifies a platform name (e.g. via the :option:`cmake -A`
2019-11-11 23:01:05 +01:00
option or via the :envvar:`CMAKE_GENERATOR_PLATFORM` environment variable)
the value will be available in this variable.
2015-04-27 22:25:09 +02:00
The value of this variable should never be modified by project code.
A toolchain file specified by the :variable:`CMAKE_TOOLCHAIN_FILE`
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.
2017-07-20 19:35:53 +02:00
Platform specification is supported only on specific generators:
* For :ref:`Visual Studio Generators` with VS 2005 and above this
specifies the target architecture.
2018-10-28 12:09:07 +01:00
* For :generator:`Green Hills MULTI` this specifies the target architecture.
2017-07-20 19:35:53 +02:00
See native build system documentation for allowed platform names.
Visual Studio Platform Selection
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
On :ref:`Visual Studio Generators` the selected platform name
is provided in the :variable:`CMAKE_VS_PLATFORM_NAME` variable.