From 8ecb6459345c550b77d8f689ed397137f2855fca Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 3 Apr 2023 11:24:55 -0400 Subject: VS: Select Windows SDK matching WindowsSDKVersion env var In an environment established by `vcvarsall.bat` or similar, this environment variable may be set to select a Windows SDK version. If the VS generator is used in such an environment, use that SDK. This is similar to how `CMAKE_GENERATOR_INSTANCE` defaults using a `VS##0COMNTOOLS` environment variable. Fixes: #17992 --- Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Help') diff --git a/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst b/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst index d69bb7b274..2c14d3900d 100644 --- a/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst +++ b/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst @@ -12,6 +12,14 @@ VS 2015 and above support specification of a Windows SDK version: as documented by :ref:`Visual Studio Platform Selection`, that SDK version is selected. +* Otherwise, if the ``WindowsSDKVersion`` environment variable + is set to an available SDK version, that version is selected. + This is intended for use in environments established by ``vcvarsall.bat`` + or similar scripts. + + .. versionadded:: 3.27 + This is enabled by policy :policy:`CMP0149`. + * Otherwise, if :variable:`CMAKE_SYSTEM_VERSION` is set to an available SDK version, that version is selected. -- cgit v1.2.1