diff options
author | Brad King <brad.king@kitware.com> | 2013-01-15 19:43:05 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-01-15 19:43:05 (GMT) |
commit | 3a7d1ce3ff0ea0565d463a341f42acd6bed8a6c4 (patch) | |
tree | 8eb91157276663e3b816a5f5ed47afa12e6ee5a6 /Source/cmGeneratorExpression.cxx | |
parent | 33d4e0db3fbe9441a227052c5fea5bc1d57af6cc (diff) | |
parent | 1d74ba21f6ee70936191c94448c88fd10eb1e81c (diff) | |
download | CMake-3a7d1ce3ff0ea0565d463a341f42acd6bed8a6c4.zip CMake-3a7d1ce3ff0ea0565d463a341f42acd6bed8a6c4.tar.gz CMake-3a7d1ce3ff0ea0565d463a341f42acd6bed8a6c4.tar.bz2 |
Merge topic 'test-export-iface-genex'
1d74ba2 Test evaluation target via export for generator expressions
522bdac Export the INTERFACE_PIC property.
4ee872c Make the BUILD_INTERFACE of export()ed targets work.
1d47cd9 Add a test for the interfaces in targets exported from the build tree.
6c828f9 Move the exported check for file existence.
cfd4f0a Move the exported check for dependencies of targets
d8fe1fc Only generate one check per missing target.
f623d37 Don't write a comment in the export file without the code.
b279f2b Strip consecutive semicolons when preprocessing genex strings.
Diffstat (limited to 'Source/cmGeneratorExpression.cxx')
-rw-r--r-- | Source/cmGeneratorExpression.cxx | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index d306dee..78ae8f2 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -148,6 +148,38 @@ cmCompiledGeneratorExpression::~cmCompiledGeneratorExpression() } //---------------------------------------------------------------------------- +static std::string stripEmptyListElements(const std::string &input) +{ + std::string result; + + const char *c = input.c_str(); + bool skipSemiColons = true; + for ( ; *c; ++c) + { + if(c[0] == ';') + { + if(skipSemiColons) + { + continue; + } + skipSemiColons = true; + } + else + { + skipSemiColons = false; + } + result += *c; + } + + if (!result.empty() && *(result.end() - 1) == ';') + { + result.resize(result.size() - 1); + } + + return result; +} + +//---------------------------------------------------------------------------- static std::string stripAllGeneratorExpressions(const std::string &input) { std::string result; @@ -186,7 +218,7 @@ static std::string stripAllGeneratorExpressions(const std::string &input) lastPos = pos; } result += input.substr(lastPos); - return result; + return stripEmptyListElements(result); } //---------------------------------------------------------------------------- @@ -247,7 +279,7 @@ static std::string stripExportInterface(const std::string &input, } result += input.substr(lastPos); - return result; + return stripEmptyListElements(result); } //---------------------------------------------------------------------------- |