Problem: Differences in detected default WindowsSDK on two different machines

So the only solution would be to set CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION

Setting that won’t do anything. It’s meant only for CMake to report what it selected.

Windows Server 2012, in which case CMake does not select Windows 10 SDK

What is CMAKE_HOST_SYSTEM_VERSION on that OS? I suspect it is not 10. CMake by default targets the host’s version.

One can explicitly pass -DCMAKE_SYSTEM_VERSION=10.0 to tell CMake to target Windows 10.