Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
CMake
CMake
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 2,684
    • Issues 2,684
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 18
    • Merge Requests 18
  • Packages
    • Packages
    • Container Registry
  • External Wiki
    • External Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • CMake
  • CMakeCMake
  • Issues
  • #20037

Closed
Open
Opened Nov 27, 2019 by Charles Machalow@csm10495
  • Report abuse
  • New issue
Report abuse New issue

Can't Set Windows SDK Version (For VS 2015 Project)

Here is a simple CMakeLists.txt file:

cmake_minimum_required(VERSION 3.6.3)
set(CMAKE_SYSTEM_VERSION "10.0.17763.0" CACHE STRING INTERNAL FORCE)
set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION "10.0.17763.0" CACHE STRING INTERNAL FORCE)

project(SimpleProject)
add_executable(SimpleProject "Source.cpp")

For some reason, if I generate with cmake . -G "Visual Studio 14 2015" -A Win32, I see:

<WindowsTargetPlatformVersion>10.0.10586.0</WindowsTargetPlatformVersion>

In the build it also says:

-- Selecting Windows SDK version 10.0.10586.0 to target Windows 10.0.17763.0.

If I generate a VS 2019 project instead, it works correctly. Why wouldn't the same work for 2015? I can manually change it once in the IDE to match the SDK version I'm trying to use, but can't seem to do it from CMake. Thanks!

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: cmake/cmake#20037