From 5117389931e1c845d81a9b50382d42e0cfb46bdc Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 1 Oct 2019 11:23:12 -0400 Subject: 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 --- Modules/CMakeDetermineCompilerId.cmake | 8 +++++++- Source/cmGlobalVisualStudioVersionedGenerator.cxx | 4 +++- 2 files changed, 10 insertions(+), 2 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 "") + if(CMAKE_VS_PLATFORM_TOOLSET_VERSION VERSION_GREATER_EQUAL "14.20") + set(id_sep ".") + else() + set(id_sep "\\") + endif() + set(id_toolset_version_props "") + unset(id_sep) endif() endif() else() diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx index 2ba1aff..1eca1f6 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx +++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx @@ -390,7 +390,9 @@ std::string cmGlobalVisualStudioVersionedGenerator::GetAuxiliaryToolset() const GetVSInstance(instancePath); std::stringstream path; path << instancePath; - path << "/VC/Auxiliary/Build/"; + path << "/VC/Auxiliary/Build"; + path << (cmSystemTools::VersionCompareGreaterEq(version, "14.20") ? '.' + : '/'); path << version; path << "/Microsoft.VCToolsVersion." << version << ".props"; -- cgit v0.12