diff options
author | Brad King <brad.king@kitware.com> | 2019-04-03 16:06:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-04-04 15:35:38 (GMT) |
commit | 33ee7793300f6ef9f5206e5a0539c192affa3d23 (patch) | |
tree | b6a18300ac8b98cdecf0897ba3a1128d21269151 /Modules/InstallRequiredSystemLibraries.cmake | |
parent | d8cf8380fb9a539b3b2b6876f2eb34fc9bddbdac (diff) | |
download | CMake-33ee7793300f6ef9f5206e5a0539c192affa3d23.zip CMake-33ee7793300f6ef9f5206e5a0539c192affa3d23.tar.gz CMake-33ee7793300f6ef9f5206e5a0539c192affa3d23.tar.bz2 |
IRSL: Fix discovery of VS 2019 v142 toolset redistributables
Since VS 2017's v141 toolset there is no longer a simple equation to
calculate the redist name, dll version, and VS IDE version from just the
MSVC toolset version. Refactor the logic to use hard-coded values and
warn when a new version is not supported.
Fixes: #19125
Diffstat (limited to 'Modules/InstallRequiredSystemLibraries.cmake')
-rw-r--r-- | Modules/InstallRequiredSystemLibraries.cmake | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index 5ba8687..2f34a7a 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -210,20 +210,25 @@ if(MSVC) set(_MSVC_IDE_VERSION "") if(MSVC_VERSION GREATER_EQUAL 2000) message(WARNING "MSVC ${MSVC_VERSION} not yet supported.") - elseif(MSVC_TOOLSET_VERSION) - set(MSVC_REDIST_NAME VC${MSVC_TOOLSET_VERSION}) + elseif(MSVC_VERSION_VERSION GREATER_EQUAL 143) + message(WARNING "MSVC toolset v${MSVC_VERSION_VERSION} not yet supported.") + elseif(MSVC_TOOLSET_VERSION EQUAL 142) + # FIXME: VS 2019 RC 4 uses VC141 but an update will fix it to be VC142. + set(MSVC_REDIST_NAME VC141) + set(_MSVC_DLL_VERSION 140) + set(_MSVC_IDE_VERSION 16) + elseif(MSVC_TOOLSET_VERSION EQUAL 141) + set(MSVC_REDIST_NAME VC141) + set(_MSVC_DLL_VERSION 140) + set(_MSVC_IDE_VERSION 15) if(MSVC_VERSION EQUAL 1910) # VS2017 named this differently prior to update 3. set(MSVC_REDIST_NAME VC150) endif() - + elseif(MSVC_TOOLSET_VERSION) + set(MSVC_REDIST_NAME VC${MSVC_TOOLSET_VERSION}) math(EXPR _MSVC_DLL_VERSION "${MSVC_TOOLSET_VERSION} / 10 * 10") - - if(MSVC_TOOLSET_VERSION EQUAL 141) - set(_MSVC_IDE_VERSION 15) - else() - math(EXPR _MSVC_IDE_VERSION "${MSVC_TOOLSET_VERSION} / 10") - endif() + math(EXPR _MSVC_IDE_VERSION "${MSVC_TOOLSET_VERSION} / 10") endif() set(_MSVCRT_DLL_VERSION "") |