summaryrefslogtreecommitdiffstats
path: root/Help/generator
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-01-09 19:30:10 (GMT)
committerBrad King <brad.king@kitware.com>2019-01-11 16:04:51 (GMT)
commit57e48f16f2c3b73fb27057267c8092a41005bb75 (patch)
treea4ffcf1bb1bcb8186ca7504cadd1ad5618852f50 /Help/generator
parentbdef729646a5a559c295ef9c0fb83eb8a6b34905 (diff)
downloadCMake-57e48f16f2c3b73fb27057267c8092a41005bb75.zip
CMake-57e48f16f2c3b73fb27057267c8092a41005bb75.tar.gz
CMake-57e48f16f2c3b73fb27057267c8092a41005bb75.tar.bz2
VS: Add Visual Studio 16 2019 generator
Add this generator *without* support for specifying the target architecture in the generator name. cmake-gui will be taught to provide a field for this, and command-line builds can use -A. Also, teach this generator to select a default target architecture based on the host architecture. Fixes: #18689 Inspired-by: Egor Pugin <egor.pugin@gmail.com>
Diffstat (limited to 'Help/generator')
-rw-r--r--Help/generator/Visual Studio 16 2019.rst49
1 files changed, 49 insertions, 0 deletions
diff --git a/Help/generator/Visual Studio 16 2019.rst b/Help/generator/Visual Studio 16 2019.rst
new file mode 100644
index 0000000..6f2bc56
--- /dev/null
+++ b/Help/generator/Visual Studio 16 2019.rst
@@ -0,0 +1,49 @@
+Visual Studio 16 2019
+---------------------
+
+Generates Visual Studio 16 (VS 2019) project files.
+
+Project Types
+^^^^^^^^^^^^^
+
+Only Visual C++ and C# projects may be generated. Other types of
+projects (JavaScript, Powershell, Python, etc.) are not supported.
+
+Instance Selection
+^^^^^^^^^^^^^^^^^^
+
+VS 2019 supports multiple installations on the same machine.
+The :variable:`CMAKE_GENERATOR_INSTANCE` variable may be set as a
+cache entry containing the absolute path to a Visual Studio instance.
+If the value is not specified explicitly by the user or a toolchain file,
+CMake queries the Visual Studio Installer to locate VS instances, chooses
+one, and sets the variable as a cache entry to hold the value persistently.
+
+When CMake first chooses an instance, if the ``VS160COMNTOOLS`` environment
+variable is set and points to the ``Common7/Tools`` directory within
+one of the instances, that instance will be used. Otherwise, if more
+than one instance is installed we do not define which one is chosen
+by default.
+
+Platform Selection
+^^^^^^^^^^^^^^^^^^
+
+The default target platform name (architecture) is that of the host.
+
+The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
+via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
+name (architecture). For example:
+
+* ``cmake -G "Visual Studio 16 2019" -A Win32``
+* ``cmake -G "Visual Studio 16 2019" -A x64``
+* ``cmake -G "Visual Studio 16 2019" -A ARM``
+* ``cmake -G "Visual Studio 16 2019" -A ARM64``
+
+Toolset Selection
+^^^^^^^^^^^^^^^^^
+
+The ``v142`` toolset that comes with Visual Studio 16 2019 is selected by
+default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
+via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+
+.. include:: VS_TOOLSET_HOST_ARCH.txt