diff options
author | Brad King <brad.king@kitware.com> | 2019-12-12 16:22:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-12-12 16:28:34 (GMT) |
commit | d8d4924d982311477225ca73f15442c9410ef7ed (patch) | |
tree | 7fe4ba1b31f6016a8c90e952bad26c1d134be38e /Modules/CMakeDetermineCompilerId.cmake | |
parent | 4771c4e447c88a0e6a361d98c2c6f44ac7746ad3 (diff) | |
download | CMake-d8d4924d982311477225ca73f15442c9410ef7ed.zip CMake-d8d4924d982311477225ca73f15442c9410ef7ed.tar.gz CMake-d8d4924d982311477225ca73f15442c9410ef7ed.tar.bz2 |
VS: Fix support for v142 toolset minor versions in VS 16.5+
The fix in commit 5117389931 (VS: Fix support for v142 toolset minor
versions, 2019-10-01, v3.16.0-rc1~32^2) worked around a bug in VS's
placement of toolset files. VS 16.5 will fix that bug and restore the
original pattern for locations of toolset files. Update our logic to
look for both possibilities.
Issue: #19779
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 908e530..7b571c3 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -284,10 +284,11 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} set(id_cl icl.exe) endif() if(CMAKE_VS_PLATFORM_TOOLSET_VERSION) + set(id_sep "\\") if(CMAKE_VS_PLATFORM_TOOLSET_VERSION VERSION_GREATER_EQUAL "14.20") - set(id_sep ".") - else() - set(id_sep "\\") + if(EXISTS "${CMAKE_GENERATOR_INSTANCE}/VC/Auxiliary/Build.${CMAKE_VS_PLATFORM_TOOLSET_VERSION}/Microsoft.VCToolsVersion.${CMAKE_VS_PLATFORM_TOOLSET_VERSION}.props") + set(id_sep ".") + endif() endif() set(id_toolset_version_props "<Import Project=\"${CMAKE_GENERATOR_INSTANCE}\\VC\\Auxiliary\\Build${id_sep}${CMAKE_VS_PLATFORM_TOOLSET_VERSION}\\Microsoft.VCToolsVersion.${CMAKE_VS_PLATFORM_TOOLSET_VERSION}.props\" />") unset(id_sep) |