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.
Also add general infrastructure for generator instance selection using CMAKE_GENERATOR_INSTANCE
, similar to what we already have for CMAKE_GENERATOR_{PLATFORM,TOOLSET}
. Currently it is only needed for VS 2017 but other generators like Xcode may be able to use it later.
Fixes: #17268 (closed)