Imported Upstream version 3.25.0
[platform/upstream/cmake.git] / Help / generator / Visual Studio 16 2019.rst
1 Visual Studio 16 2019
2 ---------------------
3
4 .. versionadded:: 3.14
5
6 Generates Visual Studio 16 (VS 2019) 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 2019 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 16 2019" -A Win32``
32 * ``cmake -G "Visual Studio 16 2019" -A x64``
33 * ``cmake -G "Visual Studio 16 2019" -A ARM``
34 * ``cmake -G "Visual Studio 16 2019" -A ARM64``
35
36 Toolset Selection
37 ^^^^^^^^^^^^^^^^^
38
39 The ``v142`` toolset that comes with Visual Studio 16 2019 is selected by
40 default.  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