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 /Help | |
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 'Help')
-rw-r--r-- | Help/manual/cmake-variables.7.rst | 1 | ||||
-rw-r--r-- | Help/release/dev/vs-version-var.rst | 6 | ||||
-rw-r--r-- | Help/variable/CMAKE_GENERATOR_INSTANCE.rst | 3 | ||||
-rw-r--r-- | Help/variable/CMAKE_VS_VERSION_BUILD_NUMBER.rst | 14 |
4 files changed, 24 insertions, 0 deletions
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 2a1e017..23d8256 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -131,6 +131,7 @@ Variables that Provide Information /variable/CMAKE_VS_TARGET_FRAMEWORK_IDENTIFIER /variable/CMAKE_VS_TARGET_FRAMEWORK_TARGETS_VERSION /variable/CMAKE_VS_TARGET_FRAMEWORK_VERSION + /variable/CMAKE_VS_VERSION_BUILD_NUMBER /variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION /variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM /variable/CMAKE_XCODE_BUILD_SYSTEM diff --git a/Help/release/dev/vs-version-var.rst b/Help/release/dev/vs-version-var.rst new file mode 100644 index 0000000..09daab7 --- /dev/null +++ b/Help/release/dev/vs-version-var.rst @@ -0,0 +1,6 @@ +vs-version-var +-------------- + +* A :variable:`CMAKE_VS_VERSION_BUILD_NUMBER` variable is now set by + :ref:`Visual Studio Generators` for VS 2017 and above to report the + four-component Visual Studio version number. diff --git a/Help/variable/CMAKE_GENERATOR_INSTANCE.rst b/Help/variable/CMAKE_GENERATOR_INSTANCE.rst index 0607843..4317622 100644 --- a/Help/variable/CMAKE_GENERATOR_INSTANCE.rst +++ b/Help/variable/CMAKE_GENERATOR_INSTANCE.rst @@ -59,3 +59,6 @@ to hold the value persistently. If an environment variable of the form is set and points to the ``Common7/Tools`` directory within one of the VS instances, that instance will be used. Otherwise, if more than one VS instance is installed we do not define which one is chosen by default. + +The VS version build number of the selected VS instance is provided in +the :variable:`CMAKE_VS_VERSION_BUILD_NUMBER` variable. diff --git a/Help/variable/CMAKE_VS_VERSION_BUILD_NUMBER.rst b/Help/variable/CMAKE_VS_VERSION_BUILD_NUMBER.rst new file mode 100644 index 0000000..f86ed7c --- /dev/null +++ b/Help/variable/CMAKE_VS_VERSION_BUILD_NUMBER.rst @@ -0,0 +1,14 @@ +CMAKE_VS_VERSION_BUILD_NUMBER +----------------------------- + +.. versionadded:: 3.26 + +Visual Studio version. + +:ref:`Visual Studio Generators` for VS 2017 and above set this +variable to the Visual Studio version build number in the format +``<major>.<minor>.<date>.<build>``. + +.. include:: CMAKE_VS_VERSION_BUILD_NUMBER_COMPONENTS.txt + +See also the :variable:`CMAKE_GENERATOR_INSTANCE` variable. |