File: CMAKE_GENERATOR_PLATFORM.rst

package info (click to toggle)
cmake 4.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 152,336 kB
  • sloc: ansic: 403,896; cpp: 303,920; sh: 4,105; python: 3,583; yacc: 3,106; lex: 1,279; f90: 538; asm: 471; lisp: 375; cs: 270; java: 266; fortran: 239; objc: 215; perl: 213; xml: 198; makefile: 111; javascript: 83; pascal: 63; tcl: 55; php: 25; ruby: 22
file content (75 lines) | stat: -rw-r--r-- 2,789 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
CMAKE_GENERATOR_PLATFORM
------------------------

.. versionadded:: 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:`cmake -A`
option or via the :envvar:`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:`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.

Platform specification is supported only on specific generators:

* For :ref:`Visual Studio Generators` with VS 2005 and above this
  specifies the target architecture.

* For :generator:`Green Hills MULTI` this specifies the target architecture.

See native build system documentation for allowed platform names.

.. _`Visual Studio Platform Selection`:

Visual Studio Platform Selection
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The :ref:`Visual Studio Generators` support platform specification
using one of these forms:

* ``platform``
* ``platform[,key=value]*``
* ``key=value[,key=value]*``

The ``platform`` specifies the target platform (VS target architecture),
such as ``x64``, ``ARM64``, or ``Win32``.  The selected platform
name is provided in the :variable:`CMAKE_VS_PLATFORM_NAME` variable.

The ``key=value`` pairs form a comma-separated list of options to
specify generator-specific details of the platform selection.
Supported pairs are:

``version=<version>``
  .. versionadded:: 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
  :variable:`CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION` variable to the
  selected SDK version.

  The ``<version>`` may be one of:

  ``10.0``
    Specify that any 10.0 SDK version may be used, and let Visual Studio
    pick one.  This is supported by VS 2019 and above.

  ``10.0.<build>.<increment>``
    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 :variable:`CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM`,
    if that variable is set.

  ``8.1``
    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.

  If the ``version`` field is not specified, CMake selects a version as
  described in the :variable:`CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION`
  variable documentation.