mirror of
https://github.com/reactos/CMake.git
synced 2025-04-03 15:51:36 +00:00

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
23 lines
760 B
CMake
23 lines
760 B
CMake
include(RunCMake)
|
|
|
|
if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio 1[56789]")
|
|
set(RunCMake_GENERATOR_INSTANCE "")
|
|
run_cmake(DefaultInstance)
|
|
|
|
set(RunCMake_GENERATOR_INSTANCE "${RunCMake_SOURCE_DIR}/instance_does_not_exist")
|
|
run_cmake(MissingInstance)
|
|
set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/MissingInstance-toolchain.cmake)
|
|
run_cmake(MissingInstanceToolchain)
|
|
unset(RunCMake_TEST_OPTIONS)
|
|
else()
|
|
set(RunCMake_GENERATOR_INSTANCE "")
|
|
run_cmake(NoInstance)
|
|
|
|
set(RunCMake_GENERATOR_INSTANCE "Bad Instance")
|
|
run_cmake(BadInstance)
|
|
|
|
set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/BadInstance-toolchain.cmake)
|
|
run_cmake(BadInstanceToolchain)
|
|
unset(RunCMake_TEST_OPTIONS)
|
|
endif()
|