diff options
author | Brad King <brad.king@kitware.com> | 2018-11-20 14:24:56 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-11-20 14:25:03 (GMT) |
commit | 4b94f3420c78e1bb7aa1324973e3ec76ba765c27 (patch) | |
tree | ea8b7987aab113a728f11e09d20048ad9451a716 | |
parent | d851a8b457251a577f10055d9fb277b75a82da6c (diff) | |
parent | 01c7d9ce863d6f8bcae578b500dd2e8ba2d97967 (diff) | |
download | CMake-4b94f3420c78e1bb7aa1324973e3ec76ba765c27.zip CMake-4b94f3420c78e1bb7aa1324973e3ec76ba765c27.tar.gz CMake-4b94f3420c78e1bb7aa1324973e3ec76ba765c27.tar.bz2 |
Merge topic 'irsl-ucrt-version'
01c7d9ce86 IRSL: Detect versioned Windows Universal CRT directories
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2637
-rw-r--r-- | Modules/InstallRequiredSystemLibraries.cmake | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index 9a5e64d..5ba8687 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -303,7 +303,15 @@ if(MSVC) get_filename_component(windows_kits_dir "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE) set(programfilesx86 "ProgramFiles(x86)") - find_path(WINDOWS_KITS_DIR NAMES Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll + if(";${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION};$ENV{UCRTVersion};$ENV{WindowsSDKVersion};" MATCHES [=[;(10\.[0-9.]+)[;\]]=]) + set(__ucrt_version "${CMAKE_MATCH_1}/") + else() + set(__ucrt_version "") + endif() + find_path(WINDOWS_KITS_DIR + NAMES + Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll + Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll PATHS $ENV{CMAKE_WINDOWS_KITS_10_DIR} "${windows_kits_dir}" @@ -314,11 +322,19 @@ if(MSVC) # Glob the list of UCRT DLLs. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) - file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll") + if(EXISTS "${WINDOWS_KITS_DIR}/Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll") + file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll") + else() + file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll") + endif() list(APPEND __install__libs ${__ucrt_dlls}) endif() if(CMAKE_INSTALL_DEBUG_LIBRARIES) - file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${CMAKE_MSVC_ARCH}/ucrt/*.dll") + if(EXISTS "${WINDOWS_KITS_DIR}/bin/${__ucrt_version}${CMAKE_MSVC_ARCH}/ucrt/ucrtbased.dll") + file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${__ucrt_version}${CMAKE_MSVC_ARCH}/ucrt/*.dll") + else() + file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${CMAKE_MSVC_ARCH}/ucrt/*.dll") + endif() list(APPEND __install__libs ${__ucrt_dlls}) endif() endif() |