summaryrefslogtreecommitdiffstats
path: root/Modules/InstallRequiredSystemLibraries.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-05-12 15:10:23 (GMT)
committerBrad King <brad.king@kitware.com>2016-05-12 15:10:23 (GMT)
commit6b0b0660740e879ba90cc4a69293a46ad28c896c (patch)
tree42135ca6160a8b5ab08582903c97b3badf8cd4b7 /Modules/InstallRequiredSystemLibraries.cmake
parentbbf8c03b4f04ffcf2bd96b6408e4fa3598b2526f (diff)
downloadCMake-6b0b0660740e879ba90cc4a69293a46ad28c896c.zip
CMake-6b0b0660740e879ba90cc4a69293a46ad28c896c.tar.gz
CMake-6b0b0660740e879ba90cc4a69293a46ad28c896c.tar.bz2
InstallRequiredSystemLibraries: Optionally install Windows UCRT (#16073)
Diffstat (limited to 'Modules/InstallRequiredSystemLibraries.cmake')
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake23
1 files changed, 23 insertions, 0 deletions
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 89f3d50..aa84077 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -23,6 +23,11 @@
# Set to TRUE to install only the debug runtime libraries with MSVC
# tools even if the release runtime libraries are also available.
#
+# ``CMAKE_INSTALL_UCRT_LIBRARIES``
+# Set to TRUE to install the Windows Universal CRT libraries for
+# app-local deployment. This is meaningful only with MSVC from
+# Visual Studio 2015 or higher.
+#
# ``CMAKE_INSTALL_MFC_LIBRARIES``
# Set to TRUE to install the MSVC MFC runtime libraries.
#
@@ -207,6 +212,24 @@ if(MSVC)
list(APPEND __install__libs "${MSVC${v}_CRT_DIR}/msvcr${v}0d.dll")
endif()
endif()
+
+ if(CMAKE_INSTALL_UCRT_LIBRARIES AND NOT v VERSION_LESS 14)
+ # Find the Windows Universal CRT redistribution directory.
+ 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_REDIST_DIR NAMES ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
+ PATHS
+ "${windows_kits_dir}/Redist"
+ "$ENV{ProgramFiles}/Windows Kits/10/Redist"
+ "$ENV{${programfilesx86}}/Windows Kits/10/Redist"
+ )
+ mark_as_advanced(WINDOWS_KITS_REDIST_DIR)
+
+ # Glob the list of UCRT DLLs.
+ file(GLOB __ucrt_dlls "${WINDOWS_KITS_REDIST_DIR}/ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll")
+ list(APPEND __install__libs ${__ucrt_dlls})
+ endif()
endmacro()
if(MSVC10)