Commit Graph

7 Commits

Author SHA1 Message Date
Brad King
f4aa34daa7 Tests/RunCMake: Update cmake_minimum_required versions to 3.10
For policy-specific tests, use the version before the policy was
introduced.  Otherwise, use 3.10 where possible.
2024-10-03 11:52:22 -04:00
Brad King
5ce0f03cce VS: Add a variable to report the Visual Studio version build number
VS 2017 and above come with a Visual Studio Installer tool that tracks
four-component Visual Studio version numbers.  We already detect the VS
version number because it is needed to make some generation decisions.
Provide the number to projects in a `CMAKE_VS_VERSION_BUILD_NUMBER`
variable so they can use it similarly.

Fixes: #24230
2022-12-07 17:49:04 -05:00
Brad King
195d47e213 VS: Allow CMAKE_GENERATOR_INSTANCE to specify portable instance
Previously the `CMAKE_GENERATOR_INSTANCE` value was used only to filter
the instances reported by the Visual Studio Installer tool.  If the
specified install location is not known to the VS Installer, but the
user provided a `version=` field, check for the installation directly
on disk.

Fixes: #21639, #22197
2021-10-29 11:52:58 -04:00
Brad King
ec8d37b3b1 VS: Support version specification in CMAKE_GENERATOR_INSTANCE 2021-10-29 11:52:58 -04:00
Brad King
8e6d930e8c VS: Parse comma-separated fields from CMAKE_GENERATOR_INSTANCE 2021-10-29 11:52:58 -04:00
Brad King
9ffb35386f 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
2017-10-19 10:20:12 -04:00
Brad King
314613d1af Add infrastructure for generators to select a build tool instance
Add cache entry `CMAKE_GENERATOR_INSTANCE` to hold the instance location
persistently across re-runs of CMake in a given build tree.

For now we reject the option by default if explicitly set.  It will be
implemented on a per-generator basis.  Pass the setting into try_compile
project generation.  Add a RunCMake.GeneratorInstance test to cover
basic use cases for the option.  Verify that `CMAKE_GENERATOR_INSTANCE`
is empty by default, and that it is rejected when the generator does not
support a user setting.

Issue: #17268
2017-10-19 10:20:08 -04:00