diff options
author | Brad King <brad.king@kitware.com> | 2017-04-12 14:53:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-04-12 14:57:05 (GMT) |
commit | fee011946e4fe0fc20f2f6bf016851402241d554 (patch) | |
tree | c77654021ca731af00de9b77cbd5bfe6fb6771a8 /Source | |
parent | b80c6d120c4f780d579071545ddc7e642b6e6276 (diff) | |
download | CMake-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 'Source')
-rw-r--r-- | Source/cmGlobalVisualStudio14Generator.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index 4602d93..df086d3 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -220,6 +220,14 @@ std::string cmGlobalVisualStudio14Generator::GetWindows10SDKVersion() std::vector<std::string> win10Roots; { + std::string win10Root; + if (cmSystemTools::GetEnv("CMAKE_WINDOWS_KITS_10_DIR", win10Root)) { + cmSystemTools::ConvertToUnixSlashes(win10Root); + win10Roots.push_back(win10Root); + } + } + + { // This logic is taken from the vcvarsqueryregistry.bat file from VS2015 // Try HKLM and then HKCU. std::string win10Root; |