summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-27 11:23:42 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-09-27 11:23:51 (GMT)
commitbb371753cb1d35c68060298ae5be6697144c9403 (patch)
treed135cf576299f5e640f38ab46d7f6b80c39d5f5d
parent2c50f7a7952235bd4f29412ceb27cf1b7f8a3591 (diff)
parentb3e6514c2a63bcbdce0016a03d1aef98ffb25092 (diff)
downloadCMake-bb371753cb1d35c68060298ae5be6697144c9403.zip
CMake-bb371753cb1d35c68060298ae5be6697144c9403.tar.gz
CMake-bb371753cb1d35c68060298ae5be6697144c9403.tar.bz2
Merge topic 'vs-guid-tolerate-no-curly'
b3e6514c VS: Adapt project parsers to support "ProjectGUID" without curly brackets Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1313
-rw-r--r--Source/cmLocalVisualStudio10Generator.cxx7
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx5
2 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index db1776a..5e81514 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -17,7 +17,12 @@ public:
virtual void CharacterDataHandler(const char* data, int length)
{
if (this->DoGUID) {
- this->GUID.assign(data + 1, length - 2);
+ if (data[0] == '{') {
+ // remove surrounding curly brackets
+ this->GUID.assign(data + 1, length - 2);
+ } else {
+ this->GUID.assign(data, length);
+ }
this->DoGUID = false;
}
}
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index a1771ee..afd71c8 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -2079,7 +2079,10 @@ public:
if (strcmp(atts[i], "ProjectGUID") == 0) {
if (atts[i + 1]) {
this->GUID = atts[i + 1];
- this->GUID = this->GUID.substr(1, this->GUID.size() - 2);
+ if (this->GUID[0] == '{') {
+ // remove surrounding curly brackets
+ this->GUID = this->GUID.substr(1, this->GUID.size() - 2);
+ }
} else {
this->GUID.clear();
}