From 0484165da017395f800d112c106cc74facca77f4 Mon Sep 17 00:00:00 2001 From: James Butler Date: Sat, 20 Jul 2019 22:15:26 -0400 Subject: IRSL: Fix typo in v143 toolset version check Fix the toolset v143 check from commit 33ee779330 (IRSL: Fix discovery of VS 2019 v142 toolset redistributables, 2019-04-03, v3.14.2~6^2) to check the correct variable. --- Modules/InstallRequiredSystemLibraries.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index 0a98895..fb2f1e9 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) -- cgit v0.12 From 13c3ec545bf6dbea3fa5e58e200471717f11c0ce Mon Sep 17 00:00:00 2001 From: James Butler Date: Sat, 20 Jul 2019 17:27:50 -0400 Subject: IRSL: Fix discovery of VS 2019 v141 toolset redistributables Since VS 2019, the v141 toolset redistributables can be found in either the VS 2019 or VS 2017 install directory. Update the logic to search multiple versions of VS. Fixes: #19488 --- Modules/InstallRequiredSystemLibraries.cmake | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index fb2f1e9..e3eeea4 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -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 -- cgit v0.12