summaryrefslogtreecommitdiffstats
path: root/Modules/InstallRequiredSystemLibraries.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-04-12 14:53:36 (GMT)
committerBrad King <brad.king@kitware.com>2017-04-12 14:57:05 (GMT)
commitfee011946e4fe0fc20f2f6bf016851402241d554 (patch)
treec77654021ca731af00de9b77cbd5bfe6fb6771a8 /Modules/InstallRequiredSystemLibraries.cmake
parentb80c6d120c4f780d579071545ddc7e642b6e6276 (diff)
downloadCMake-fee011946e4fe0fc20f2f6bf016851402241d554.zip
CMake-fee011946e4fe0fc20f2f6bf016851402241d554.tar.gz
CMake-fee011946e4fe0fc20f2f6bf016851402241d554.tar.bz2
VS: Add an environment variable for the Windows 10 kits directory
Define a `CMAKE_WINDOWS_KITS_10_DIR` environment variable to allow users to tell CMake about a custom Windows 10 SDK directory. We choose to make this an environment variable rather than a CMake variable or cache entry because: * Using a custom directory also requires custom external MSBuild configuration. Therefore users are already configuring a custom environment. * The custom directory must be set consistently in all parts of a build including nested projects. An environment variable avoids requiring users to thread the setting into nested builds. Fixes: #16743
Diffstat (limited to 'Modules/InstallRequiredSystemLibraries.cmake')
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index a3478a3..6d33fc6 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -31,6 +31,11 @@
# app-local deployment (e.g. to Windows XP). This is meaningful
# only with MSVC from Visual Studio 2015 or higher.
#
+# One may set a ``CMAKE_WINDOWS_KITS_10_DIR`` *environment variable*
+# to an absolute path to tell CMake to look for Windows 10 SDKs in
+# a custom location. The specified directory is expected to contain
+# ``Redist/ucrt/DLLs/*`` directories.
+#
# ``CMAKE_INSTALL_MFC_LIBRARIES``
# Set to TRUE to install the MSVC MFC runtime libraries.
#
@@ -258,6 +263,7 @@ if(MSVC)
set(programfilesx86 "ProgramFiles(x86)")
find_path(WINDOWS_KITS_DIR NAMES Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
PATHS
+ $ENV{CMAKE_WINDOWS_KITS_10_DIR}
"${windows_kits_dir}"
"$ENV{ProgramFiles}/Windows Kits/10"
"$ENV{${programfilesx86}}/Windows Kits/10"