1CMAKE_GENERATOR_PLATFORM 2------------------------ 3 4.. versionadded:: 3.1 5 6Generator-specific target platform specification provided by user. 7 8Some CMake generators support a target platform name to be given 9to the native build system to choose a compiler toolchain. 10If the user specifies a platform name (e.g. via the :manual:`cmake(1)` ``-A`` 11option or via the :envvar:`CMAKE_GENERATOR_PLATFORM` environment variable) 12the value will be available in this variable. 13 14The value of this variable should never be modified by project code. 15A toolchain file specified by the :variable:`CMAKE_TOOLCHAIN_FILE` 16variable may initialize ``CMAKE_GENERATOR_PLATFORM``. Once a given 17build tree has been initialized with a particular value for this 18variable, changing the value has undefined behavior. 19 20Platform specification is supported only on specific generators: 21 22* For :ref:`Visual Studio Generators` with VS 2005 and above this 23 specifies the target architecture. 24 25* For :generator:`Green Hills MULTI` this specifies the target architecture. 26 27See native build system documentation for allowed platform names. 28 29Visual Studio Platform Selection 30^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 31 32On :ref:`Visual Studio Generators` the selected platform name 33is provided in the :variable:`CMAKE_VS_PLATFORM_NAME` variable. 34