diff options
author | Brad King <brad.king@kitware.com> | 2022-12-07 22:47:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-12-07 22:49:04 (GMT) |
commit | 5ce0f03cce95fc78af766ca3e54bbab392cbb0d5 (patch) | |
tree | 6464527a909e7758eb8d2ce184d7aabec6e21f59 /Tests | |
parent | 55529c5e93f2a15d16ab90b799d5ab75c28d0422 (diff) | |
download | CMake-5ce0f03cce95fc78af766ca3e54bbab392cbb0d5.zip CMake-5ce0f03cce95fc78af766ca3e54bbab392cbb0d5.tar.gz CMake-5ce0f03cce95fc78af766ca3e54bbab392cbb0d5.tar.bz2 |
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
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/GeneratorInstance/DefaultInstance-stdout.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorInstance/DefaultInstance.cmake | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/Tests/RunCMake/GeneratorInstance/DefaultInstance-stdout.txt b/Tests/RunCMake/GeneratorInstance/DefaultInstance-stdout.txt new file mode 100644 index 0000000..078d96e --- /dev/null +++ b/Tests/RunCMake/GeneratorInstance/DefaultInstance-stdout.txt @@ -0,0 +1 @@ +-- CMAKE_VS_VERSION_BUILD_NUMBER='[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' diff --git a/Tests/RunCMake/GeneratorInstance/DefaultInstance.cmake b/Tests/RunCMake/GeneratorInstance/DefaultInstance.cmake index 9761f0c..5c5ec56 100644 --- a/Tests/RunCMake/GeneratorInstance/DefaultInstance.cmake +++ b/Tests/RunCMake/GeneratorInstance/DefaultInstance.cmake @@ -12,3 +12,5 @@ elseif(NOT IS_DIRECTORY "${CMAKE_GENERATOR_INSTANCE}") "which is not an existing directory.") endif() file(WRITE "${CMAKE_BINARY_DIR}/instance.txt" "${CMAKE_GENERATOR_INSTANCE}") + +message(STATUS "CMAKE_VS_VERSION_BUILD_NUMBER='${CMAKE_VS_VERSION_BUILD_NUMBER}'") |