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

Gilles Khouzam Gilles.Khouzam at microsoft.com
Wed Sep 23 18:48:41 EDT 2015


Ok, I've got this working as discussed.

This adds only the WINDOWS_TARGET_PLATFORM_VERSION property as it currently only supports the desktop scenario and is extracted from the rest of the Windows 10 Store support. This property enables a Windows 10 Desktop project to use a specific version of the Windows 10.

If CMAKE_SYSTEM_VERSION is set to 10.0 then the latest Windows 10 SDK but not more recent than the current build of Windows. If you want to specify a specific version to use, then there is the global property CMAKE_WINDOWS_TARGET_PLATFORM_VERSION that will be passed down to each target. To specify a value for a specific target there is the target property WINDOWS_TARGET_PLATFORM_VERSION.

There is one thing that I've changed that I want to make sure is the right thing. As it stands, CMAKE_SYSTEM_VERSION is only valid when cross-compiling, I've changed the CMakeDetermineSystem.cmake file to not use the HOST_SYSTEM_VERSION when CMAKE_SYSTEM_VERSION is set. Otherwise, we can only use this feature through CMAKE_SYSTEM_VERSION on cross-compiling scenarios.

I'm not sure what the best way to test this feature, it can be added to any desktop project on Windows 10 and it should work properly. I've tried it with CMake itself and it's working fine and building against the Win10 SDK.

Yes, you have the right versions for all the CMAKE_HOST_SYSTEM_VERSION for the different OS versions.


-----Original Message-----
From: Brad King [mailto:brad.king at kitware.com] 
Sent: Wednesday, September 23, 2015 07:17
To: Gilles Khouzam <Gilles.Khouzam at microsoft.com>
Cc: cmake-developers at cmake.org
Subject: Re: [cmake-developers] [Patch] Adding Windows 10 support

On 09/23/2015 10:03 AM, Gilles Khouzam wrote:
> If the property is not present then the default is to use the Windows 8.1 SDK.

Thanks for explaining that VS behavior.

> I'm suggesting that if the SYSTEM_NAME is Windows but the Version is 
> set to 10.0 then we can use the same logic as for Store apps.

Yes, if CMAKE_SYSTEM_NAME is "Windows" and CMAKE_SYSTEM_VERSION indicates Windows > 8.1 then we should use the latest SDK that is available but not newer than the version of Windows targeted.

BTW, what are the values of CMAKE_HOST_SYSTEM_VERSION on Windows 7, 8, 8.1, and 10 when CMake is built with the new manifest file?
IIUC they should be:

 Windows 7   => 6.1
 Windows 8   => 6.2
 Windows 8.1 => 6.3
 Windows 10  => 10.0

plus a third component for the Windows build number.

Thanks,
-Brad

-------------- next part --------------
A non-text attachment was scrubbed...
Name: WindowsTargetPlatform.patch
Type: application/octet-stream
Size: 13828 bytes
Desc: WindowsTargetPlatform.patch
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150923/412b9052/attachment-0001.obj>


More information about the cmake-developers mailing list