Commit f33fed6f authored by Piyush Aggarwal's avatar Piyush Aggarwal 🎮
Browse files

windows: fix support for WIN_SDK < 19041

inspired by :
Since CMake doesn't really has a way of providing the Win10 SDK's version ( see: )
we read the XML file set up by the SDK and filter the SDK version out of it
parent c0cbcc0d
Pipeline #66106 passed with stage
in 4 minutes and 6 seconds
...@@ -101,7 +101,11 @@ if (KF5_OPTIONAL_COMPONENTS) ...@@ -101,7 +101,11 @@ if (KF5_OPTIONAL_COMPONENTS)
endif() endif()
if (WIN32) if (WIN32)
string(REGEX MATCH "[0-9][0-9][0-9][0-9][0-9]" WIN_SDK_VERSION "${CMAKE_SYSTEM_VERSION}" ) get_filename_component(WINDOWS_KITS_DIR
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE)
string(REGEX MATCH "PlatformIdentity[^\n]*" PLATFORM_IDENTITY "${SDK_MANIFEST}" )
string(REGEX MATCH "[0-9][0-9][0-9][0-9][0-9]" WIN_SDK_VERSION "${PLATFORM_IDENTITY}" )
add_compile_definitions(WIN_SDK_VERSION=${WIN_SDK_VERSION}) add_compile_definitions(WIN_SDK_VERSION=${WIN_SDK_VERSION})
endif() endif()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment