mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
VS: Select and save a VS 2017 instance persistently
Visual Studio 2017 supports multiple instances installed on a single machine. We use the Visual Studio Installer tool to enumerate instances and select one. Once we select an instance for a given build tree, save the result in `CMAKE_GENERATOR_INSTANCE` so we can re-configure the tree with the same instance on future re-runs of CMake. Fixes: #17268
This commit is contained in:
@@ -19,13 +19,17 @@ Instance Selection
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
VS 2017 supports multiple installations on the same machine.
|
||||
CMake queries the Visual Studio Installer to locate VS instances.
|
||||
If more than one instance is installed we do not define which one
|
||||
is chosen by default. If the ``VS150COMNTOOLS`` environment variable
|
||||
is set and points to the ``Common7/Tools`` directory within one of
|
||||
the instances, that instance will be used. The environment variable
|
||||
must remain consistently set whenever CMake is re-run within a given
|
||||
build tree.
|
||||
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 ``VS150COMNTOOLS`` 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.
|
||||
|
||||
Toolset Selection
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
Reference in New Issue
Block a user