Imported Upstream version 3.25.0
[platform/upstream/cmake.git] / Help / generator / Visual Studio 17 2022.rst
1 Visual Studio 17 2022
2 ---------------------
3
4 .. versionadded:: 3.21
5
6 Generates Visual Studio 17 (VS 2022) project files.
7
8 Project Types
9 ^^^^^^^^^^^^^
10
11 Only Visual C++ and C# projects may be generated (and Fortran with
12 Intel compiler integration).  Other types of projects (JavaScript,
13 Powershell, Python, etc.) are not supported.
14
15 Instance Selection
16 ^^^^^^^^^^^^^^^^^^
17
18 VS 2022 supports multiple installations on the same machine.  The
19 :variable:`CMAKE_GENERATOR_INSTANCE` variable may be used to select one.
20
21 Platform Selection
22 ^^^^^^^^^^^^^^^^^^
23
24 The default target platform name (architecture) is that of the host
25 and is provided in the :variable:`CMAKE_VS_PLATFORM_NAME_DEFAULT` variable.
26
27 The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
28 via the :option:`cmake -A` option, to specify a target platform
29 name (architecture).  For example:
30
31 * ``cmake -G "Visual Studio 17 2022" -A Win32``
32 * ``cmake -G "Visual Studio 17 2022" -A x64``
33 * ``cmake -G "Visual Studio 17 2022" -A ARM``
34 * ``cmake -G "Visual Studio 17 2022" -A ARM64``
35
36 Toolset Selection
37 ^^^^^^^^^^^^^^^^^
38
39 The ``v143`` toolset that comes with VS 17 2022 is selected by default.
40 The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
41 via the :option:`cmake -T` option, to specify another toolset.
42
43 .. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
44    By default this generator uses the 64-bit variant on x64 hosts and
45    the 32-bit variant otherwise.
46
47 .. include:: VS_TOOLSET_HOST_ARCH.txt