summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio10Generator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGlobalVisualStudio10Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index c93b140..09679cd 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -218,15 +218,17 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset(
if (vcPlatformToolsetRegex.find(platformToolset) ||
platformToolset == "Test Toolset"_s) {
std::string versionToolset = this->GeneratorToolsetVersion;
- cmsys::RegularExpression versionToolsetRegex("^[0-9][0-9]\\.[0-9][0-9]");
+ cmsys::RegularExpression versionToolsetRegex(
+ "^([0-9][0-9])\\.([0-9])[0-9](\\.|$)");
if (versionToolsetRegex.find(versionToolset)) {
- versionToolset = cmStrCat('v', versionToolset.erase(2, 1));
+ versionToolset = cmStrCat('v', versionToolsetRegex.match(1),
+ versionToolsetRegex.match(2));
} else {
// Version not recognized. Clear it.
versionToolset.clear();
}
- if (!cmHasPrefix(versionToolset, platformToolset)) {
+ if (versionToolset != platformToolset) {
mf->IssueMessage(
MessageType::FATAL_ERROR,
cmStrCat("Generator\n"