mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-19 11:18:40 +08:00
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
This commit is contained in:
@@ -284,7 +284,13 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
|
|||||||
set(id_cl icl.exe)
|
set(id_cl icl.exe)
|
||||||
endif()
|
endif()
|
||||||
if(CMAKE_VS_PLATFORM_TOOLSET_VERSION)
|
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()
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
|
@@ -390,7 +390,9 @@ std::string cmGlobalVisualStudioVersionedGenerator::GetAuxiliaryToolset() const
|
|||||||
GetVSInstance(instancePath);
|
GetVSInstance(instancePath);
|
||||||
std::stringstream path;
|
std::stringstream path;
|
||||||
path << instancePath;
|
path << instancePath;
|
||||||
path << "/VC/Auxiliary/Build/";
|
path << "/VC/Auxiliary/Build";
|
||||||
|
path << (cmSystemTools::VersionCompareGreaterEq(version, "14.20") ? '.'
|
||||||
|
: '/');
|
||||||
path << version;
|
path << version;
|
||||||
path << "/Microsoft.VCToolsVersion." << version << ".props";
|
path << "/Microsoft.VCToolsVersion." << version << ".props";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user