Imported Upstream version 3.25.0
[platform/upstream/cmake.git] / Help / generator / Visual Studio 15 2017.rst
1 Visual Studio 15 2017
2 ---------------------
3
4 .. versionadded:: 3.7.1
5
6 Generates Visual Studio 15 (VS 2017) 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 .. versionadded:: 3.11
19
20 VS 2017 supports multiple installations on the same machine.  The
21 :variable:`CMAKE_GENERATOR_INSTANCE` variable may be used to select one.
22
23 Platform Selection
24 ^^^^^^^^^^^^^^^^^^
25
26 The default target platform name (architecture) is ``Win32``.
27
28 The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
29 via the :option:`cmake -A` option, to specify a target platform
30 name (architecture).  For example:
31
32 * ``cmake -G "Visual Studio 15 2017" -A Win32``
33 * ``cmake -G "Visual Studio 15 2017" -A x64``
34 * ``cmake -G "Visual Studio 15 2017" -A ARM``
35 * ``cmake -G "Visual Studio 15 2017" -A ARM64``
36
37 For compatibility with CMake versions prior to 3.1, one may specify
38 a target platform name optionally at the end of the generator name.
39 This is supported only for:
40
41 ``Visual Studio 15 2017 Win64``
42   Specify target platform ``x64``.
43
44 ``Visual Studio 15 2017 ARM``
45   Specify target platform ``ARM``.
46
47 Toolset Selection
48 ^^^^^^^^^^^^^^^^^
49
50 The ``v141`` toolset that comes with Visual Studio 15 2017 is selected by
51 default.  The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
52 via the :option:`cmake -T` option, to specify another toolset.
53
54 .. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
55    By default this generator uses the 32-bit variant even on a 64-bit host.
56
57 .. include:: VS_TOOLSET_HOST_ARCH_LEGACY.txt