[cmake-developers] [Patch] Adding Windows 10 support

Brad King brad.king at kitware.com
Fri Sep 25 14:52:48 EDT 2015


On 09/25/2015 01:00 PM, Gilles Khouzam wrote:
> This was done deliberately to only force a value for
> CMAKE_WINDOWS_TARGET_PLATFORM_VERSION

With the approach in my patch that variable is never set by
the generator.  It chooses a WindowsTargetPlatformVersion value
and reports it in CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.
The CMAKE_WINDOWS_TARGET_PLATFORM_VERSION variable is only
for the user-defined selection.

> when the CMAKE_SYSTEM_VERSION is specified as 10.0.
> Otherwise any Windows 10 machine will use the Windows 10 SDK
> and not the Windows 8.1 SDK

Why is it wrong to target the host's version by default?
This is commonly done on other platforms.  If one is building
only for the current host this makes sense.  If one is building
for deployment then extra care is needed anyway.

> and I'm not sure that there is a way then target the Windows 8.1 SDK.

If one wants to build on a Windows 10 host but target an older
version of Windows, one can simply do -DCMAKE_SYSTEM_VERSION=6.3
for example.  This is thanks to your patch that allows it to be
set separately from CMAKE_SYSTEM_NAME.

Actually, why do we need a separate setting like
CMAKE_WINDOWS_TARGET_PLATFORM_VERSION to select this at all?
Why not just take the highest available SDK that does not
exceed CMAKE_SYSTEM_VERSION?  CMAKE_SYSTEM_VERSION is meant
exactly to specify the target OS version.  You posted
something about this here:

 https://cmake.org/Bug/view.php?id=15670#c39247

but I do not quite understand it.

Thanks,
-Brad



More information about the cmake-developers mailing list