MantisBT - CMake
View Issue Details
0015945CMake(No Category)public2016-01-29 13:512016-06-10 14:21
Gehua Yang 
 
normalminoralways
closedno change required 
WindowsWindows 10
CMake 3.4.3 
 
0015945: "Target Platform Version" Option in Visual Sutio 2015
I am trying to compile code and generate binaries that's compatible with Windows 7/8/8.1. Following MSDN's suggestion, I can set "Target Platform Version" under the General tag to use SDK 8.1, which works fine for me (see screenshot). The real problem is this change is not preserved after a CMake run.

This issue is very similar to Issue 0015686 and Issue 0015670. I read through the report under both and learned that one can use CMAKE_SYSTEM_VERSION to change the "Target Platform Version" value across all projects in a VS solution.

Perhaps it is not a bug and simply caused by not doing things right. But I cannot find any more documentation related to this on web. My apology in advance!
However, I tried to do that with CMake 3.4.3 (latest release from cmake.org), but the projects generated does not contain this TargetPlatformVersion tag and hence its value is still defaulted to 10.0.10240.0.
1. In CMake GUI, set CMAKE_SYSTEM_VERSION to "8.1". Finish Cmake.
2. Open Visual Studio 2015 and open the property page of any project.
3. Go to "General" tab.

Related to Issue 0015686 and Issue 0015670
No tags attached.
png t.png (51,982) 2016-01-29 13:51
https://public.kitware.com/Bug/file/5625/t.png
png
Issue History
2016-01-29 13:51Gehua YangNew Issue
2016-01-29 13:51Gehua YangFile Added: t.png
2016-01-29 14:03Brad KingNote Added: 0040370
2016-01-29 14:06Brad KingNote Added: 0040373
2016-01-29 14:24Gehua YangNote Added: 0040376
2016-01-29 14:30Brad KingNote Added: 0040377
2016-01-29 14:30Brad KingStatusnew => resolved
2016-01-29 14:30Brad KingResolutionopen => no change required
2016-06-10 14:21Kitware RobotNote Added: 0041271
2016-06-10 14:21Kitware RobotStatusresolved => closed

Notes
(0040370)
Brad King   
2016-01-29 14:03   
CMAKE_SYSTEM_VERSION must be defined from the beginning in a fresh build tree.
(0040373)
Brad King   
2016-01-29 14:06   
Documentation is here:

 https://cmake.org/cmake/help/v3.4/variable/CMAKE_SYSTEM_VERSION.html [^]
 https://cmake.org/cmake/help/v3.4/manual/cmake-toolchains.7.html#cross-compiling-for-windows-10-universal-applications [^]
(0040376)
Gehua Yang   
2016-01-29 14:24   
Thanks, Brad!

It worked as you described! I missed the keyword **fresh** build tree.
(0040377)
Brad King   
2016-01-29 14:30   
The documentation uses the phrase "when first configuring a new build tree".

FYI, the reason is that all this information is stored persistently in CMakeFiles/$v/CMakeSystem.cmake which is only configured on the first run.
(0041271)
Kitware Robot   
2016-06-10 14:21   
This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.