summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-07-22 14:20:06 (GMT)
committerBrad King <brad.king@kitware.com>2019-07-22 14:20:06 (GMT)
commit4cac01c63a559d7a7d39f0e3f3e094851bfbdcfc (patch)
tree69994a25bc09d994fff1e67c691865b05037444b /Modules
parentfc2a7c8b3fc95b90ff69b7bb4a16b216b8ac3671 (diff)
parent13c3ec545bf6dbea3fa5e58e200471717f11c0ce (diff)
downloadCMake-4cac01c63a559d7a7d39f0e3f3e094851bfbdcfc.zip
CMake-4cac01c63a559d7a7d39f0e3f3e094851bfbdcfc.tar.gz
CMake-4cac01c63a559d7a7d39f0e3f3e094851bfbdcfc.tar.bz2
Merge branch 'InstallRequiredSystemLibraries-redist' into release-3.15
Merge-request: !3585
Diffstat (limited to 'Modules')
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake20
1 files changed, 14 insertions, 6 deletions
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 0a98895..e3eeea4 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -210,8 +210,8 @@ if(MSVC)
set(_MSVC_IDE_VERSION "")
if(MSVC_VERSION GREATER_EQUAL 2000)
message(WARNING "MSVC ${MSVC_VERSION} not yet supported.")
- elseif(MSVC_VERSION_VERSION GREATER_EQUAL 143)
- message(WARNING "MSVC toolset v${MSVC_VERSION_VERSION} not yet supported.")
+ elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 143)
+ message(WARNING "MSVC toolset v${MSVC_TOOLSET_VERSION} not yet supported.")
elseif(MSVC_TOOLSET_VERSION EQUAL 142)
set(MSVC_REDIST_NAME VC142)
set(_MSVC_DLL_VERSION 140)
@@ -251,10 +251,18 @@ 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()
+ # The toolset and its redistributables may come with any VS version 15 or newer.
+ set(_MSVC_IDE_VERSIONS 16 15)
+ foreach(_vs_ver ${_MSVC_IDE_VERSIONS})
+ set(_vs_glob_redist_paths "")
+ cmake_host_system_information(RESULT _vs_dir QUERY VS_${_vs_ver}_DIR) # undocumented query
+ if(IS_DIRECTORY "${_vs_dir}")
+ file(GLOB _vs_glob_redist_paths "${_vs_dir}/VC/Redist/MSVC/*")
+ list(APPEND _vs_redist_paths ${_vs_glob_redist_paths})
+ endif()
+ unset(_vs_glob_redist_paths)
+ endforeach()
+ unset(_MSVC_IDE_VERSIONS)
unset(_vs_dir)
else()
get_filename_component(_vs_dir