diff options
author | Brad King <brad.king@kitware.com> | 2019-12-12 16:38:15 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-12-12 16:38:15 (GMT) |
commit | b3a536e726a601b2f17aaad14fee6cb0e215450a (patch) | |
tree | c5a53a559db3a689c63514a75d546b8f24d7ae80 /Source | |
parent | 2ed1d2cfa3f209e9db2e8aa25411f87f3e4889b3 (diff) | |
parent | 07612646fe28d86330cbd4db9cfd27be1d8fb90f (diff) | |
download | CMake-b3a536e726a601b2f17aaad14fee6cb0e215450a.zip CMake-b3a536e726a601b2f17aaad14fee6cb0e215450a.tar.gz CMake-b3a536e726a601b2f17aaad14fee6cb0e215450a.tar.bz2 |
Merge branch 'backport-3.15-vs-v142-version' into release-3.15
Merge-request: !4133
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalVisualStudioVersionedGenerator.cxx | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx index 1eca1f6..66a57eb 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx +++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx @@ -388,15 +388,17 @@ std::string cmGlobalVisualStudioVersionedGenerator::GetAuxiliaryToolset() const if (version) { std::string instancePath; GetVSInstance(instancePath); - std::stringstream path; - path << instancePath; - path << "/VC/Auxiliary/Build"; - path << (cmSystemTools::VersionCompareGreaterEq(version, "14.20") ? '.' - : '/'); - path << version; - path << "/Microsoft.VCToolsVersion." << version << ".props"; - - std::string toolsetPath = path.str(); + std::string toolsetDir = instancePath + "/VC/Auxiliary/Build"; + char sep = '/'; + if (cmSystemTools::VersionCompareGreaterEq(version, "14.20")) { + std::string toolsetDot = toolsetDir + "." + version + + "/Microsoft.VCToolsVersion." + version + ".props"; + if (cmSystemTools::PathExists(toolsetDot)) { + sep = '.'; + } + } + std::string toolsetPath = toolsetDir + sep + version + + "/Microsoft.VCToolsVersion." + version + ".props"; cmSystemTools::ConvertToUnixSlashes(toolsetPath); return toolsetPath; } |