diff options
author | Brad King <brad.king@kitware.com> | 2019-10-01 15:23:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-10-01 15:39:38 (GMT) |
commit | 5117389931e1c845d81a9b50382d42e0cfb46bdc (patch) | |
tree | c526e827ea6e08b2a582d05bac9abb159776737b /Modules/CMakeDetermineCompilerId.cmake | |
parent | 6fb747a01c27a2226fe4cbf77bc19e6d21286f81 (diff) | |
download | CMake-5117389931e1c845d81a9b50382d42e0cfb46bdc.zip CMake-5117389931e1c845d81a9b50382d42e0cfb46bdc.tar.gz CMake-5117389931e1c845d81a9b50382d42e0cfb46bdc.tar.bz2 |
VS: Fix support for v142 toolset minor versions
When using `-T v142,version=14.22` the `.props` file location is
different starting with version `14.20` than it was in `14.16` and
below. Adapt the path based on the version.
Fixes: #19779
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 02bc14b..d9002fb 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -284,7 +284,13 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} set(id_cl icl.exe) endif() if(CMAKE_VS_PLATFORM_TOOLSET_VERSION) - set(id_toolset_version_props "<Import Project=\"${CMAKE_GENERATOR_INSTANCE}\\VC\\Auxiliary\\Build\\${CMAKE_VS_PLATFORM_TOOLSET_VERSION}\\Microsoft.VCToolsVersion.${CMAKE_VS_PLATFORM_TOOLSET_VERSION}.props\" />") + if(CMAKE_VS_PLATFORM_TOOLSET_VERSION VERSION_GREATER_EQUAL "14.20") + set(id_sep ".") + else() + set(id_sep "\\") + 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) endif() endif() else() |