summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpression.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-02-28 16:39:27 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-02-28 16:54:11 (GMT)
commitf93a388c9c65ae9c8f74055e18ddf85be10a8a34 (patch)
tree36da42aa9e0170e2071f4462e48dbfb57b719a5e /Source/cmGeneratorExpression.cxx
parent42c56c824c719a640471a622f710b0b86ee02abc (diff)
downloadCMake-f93a388c9c65ae9c8f74055e18ddf85be10a8a34.zip
CMake-f93a388c9c65ae9c8f74055e18ddf85be10a8a34.tar.gz
CMake-f93a388c9c65ae9c8f74055e18ddf85be10a8a34.tar.bz2
Fix the cmGeneratorExpression::Split when leading chars are present.
In the case of input like foo$<1:bar> the preGenex should be 'foo'. In that case, the search for a ';' will not find one, and there is no preceding input to process as a non-genex list. Previously, the result of 'splitting' such a string would instead be a vector containing the same string two times.
Diffstat (limited to 'Source/cmGeneratorExpression.cxx')
-rw-r--r--Source/cmGeneratorExpression.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 34d80ec..7ea58fa 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -302,12 +302,20 @@ void cmGeneratorExpression::Split(const std::string &input,
if (!part.empty())
{
std::string::size_type startPos = input.rfind(";", pos);
- if (startPos != pos - 1 && startPos >= lastPos)
+ if (startPos == std::string::npos)
+ {
+ preGenex = part;
+ part = "";
+ }
+ else if (startPos != pos - 1 && startPos >= lastPos)
{
part = input.substr(lastPos, startPos - lastPos);
preGenex = input.substr(startPos + 1, pos - startPos - 1);
}
- cmSystemTools::ExpandListArgument(part.c_str(), output);
+ if(!part.empty())
+ {
+ cmSystemTools::ExpandListArgument(part.c_str(), output);
+ }
}
pos += 2;
int nestingLevel = 1;