6

How to pass latest Windows SDK version to CMake so I don't need to go in Visual Studio and put it manually from Configuration Proprieties - General?

VS

I've search on internet and I've found the CMAKE_SYSTEM_VERSION variable and I've tried to use

set (CMAKE_SYSTEM_VERSION 10.0)

and

set (CMAKE_SYSTEM_VERSION 10.0 (latest installed version))

but I still get version 10.0.18362.0 set as default

  • 1
    You only have `10.0.18362.0` installed. – Richard Critten Aug 27 '20 at 10:54
  • Did you set the `CMAKE_SYSTEM_VERSION` before any `project()` calls in your CMake project (as mentioned in [this](https://stackoverflow.com/a/45693321/3987854) post)? – Kevin Aug 27 '20 at 13:08
  • I've tried that but I have the same result @squareskittles – Robert-Nicolae Solca Aug 27 '20 at 14:27
  • 1
    I suggest that you could remove the CMakeCache.txt if you have already generated your project. Then you could try to reset. – Barrnet Chou Aug 28 '20 at 03:08
  • 1
    TY.Your ```CMAKE_SYSTEM_VERSION``` solved my problem. Altogether,```set (CMAKE_SYSTEM_VERSION 10.0.19041.0) project(test LANGUAGES CXX) message(STATUS "test: ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")``` – kenash0625 Dec 28 '21 at 02:13

0 Answers0