Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,805
    • Issues 3,805
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #21578

Closed
Open
Created Dec 09, 2020 by Sebastian Koerner@sebastian.koerner.berlin

VS: 2017/2019 generator ignoring target Windows Version

Unlike the VC14 generator the VS 2017,2019 generator seems to ignore the Target Windows Version. Take this call in cmake 3.17.1 on a Windows 7 host:

cmake -G "Visual Studio 16 2019" -DCMAKE_GENERATOR="Visual Studio 16 2019" -A x64 -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_SYSTEM=Windows-10.0.18362 -DCMAKE_SYSTEM_VERSION=10.0.18362 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=10.0 -DCMAKE_SYSTEM_NAME=Windows

It is meant to target Windows 10 but gives this output

-- The C compiler identification is MSVC 19.27.29112.0
-- The CXX compiler identification is MSVC 19.27.29112.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
**-- Selecting Windows SDK version 8.1 to target Windows 6.1.7601.**

The same command for -G "Visual Studio 14 Win64" -DCMAKE_GENERATOR="Visual Studio 14 Win64"

-- Selecting Windows SDK version 10.0.14393.0 to target Windows 10.0.18362.
-- The C compiler identification is MSVC 19.0.24210.0
-- The CXX compiler identification is MSVC 19.0.24210.0
-- Selecting Windows SDK version 10.0.14393.0 to target Windows 10.0.18362.
Edited Dec 09, 2020 by Brad King
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking