summaryrefslogtreecommitdiff
path: root/Modules/InstallRequiredSystemLibraries.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-27 11:42:48 -0400
committerBrad King <brad.king@kitware.com>2017-03-27 11:43:01 -0400
commit6eb609fd59d989fede93fadfc67b928ee7ab7fc2 (patch)
treec9637251915190173811a7ded67adf18866b1f1f /Modules/InstallRequiredSystemLibraries.cmake
parentcf784d9ff5555eda82d6790c359b6d6ea7f88345 (diff)
downloadcmake-6eb609fd59d989fede93fadfc67b928ee7ab7fc2.tar.gz
InstallRequiredSystemLibraries: Find VS 2017 redist directory
Use our undocumented `cmake_host_system_information` query to find the VS 2017 installation directory by asking the VS installer tool. Then look relative to that for the redist directory. Fixes: #16737
Diffstat (limited to 'Modules/InstallRequiredSystemLibraries.cmake')
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 9750a065cf..a3478a387f 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -196,6 +196,11 @@ if(MSVC)
endif()
if(NOT vs VERSION_LESS 15)
set(_vs_redist_paths "")
+ cmake_host_system_information(RESULT _vs_dir QUERY VS_${vs}_DIR) # undocumented query
+ if(IS_DIRECTORY "${_vs_dir}")
+ file(GLOB _vs_redist_paths "${_vs_dir}/VC/Redist/MSVC/*")
+ endif()
+ unset(_vs_dir)
else()
get_filename_component(_vs_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${vs}.0;InstallDir]" ABSOLUTE)