presets: Can't Set Windows SDK Version
I'm using CMake Presets to build my project. On our build server we have lot's of old Windows SDKs installed. Unfortunately old Windows SDKs are not cpp standard conformant. Locally with newer Windows SDKs I do not have such an issue. So the question is: Why is my CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION ignored.
{
"name": "_windows-base",
"hidden": true,
"architecture": {
"value": "x64",
"strategy": "external"
},
"binaryDir": "${sourceParentDir}/build/${presetName}",
"installDir": "${sourceParentDir}/build/install/${presetName}",
"generator": "Visual Studio 17 2022",
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe",
"BUILD_SHARED_LIBS": "ON",
"CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION": "10.0.22000.0"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
This results in lots of windows kit errors
C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um\oaidl.h(651,16): error C2079: 'varDefaultValue' uses undefined struct 'tagVARIANT' [C:\jenkins\workspace\MR-52d0a044da\build\foo.vcxproj]
Now the question is, why does VS 2022 generator use Windows SDK 10.0.14393.0 although i specified 10.0.22000.0. When using the Ninja Generator (with MSVC as well) there are no such issues
I found an old bug #20037 (closed) regarding VS 2015. Is there any Windows SDK filtering for VS 2022 as well?