From fb578c8635b3c09f4a838c2ec9c671d9f1be34cd Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 20 Sep 2012 12:12:00 +0200 Subject: Fix the regular expression validator for target names. Regression introduced by f1eacf0e07759b57d100dbf5d83c70e4028bcb54. Target names have different valid contents to config names. --- Source/cmGeneratorExpressionEvaluator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index acc844a..9f84ed2 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -299,7 +299,7 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode std::string name = *parameters.begin(); cmsys::RegularExpression targetValidator; - targetValidator.compile("^[A-Za-z0-9_]+$"); + targetValidator.compile("^[A-Za-z0-9_.-]+$"); if (!targetValidator.find(name.c_str())) { ::reportError(context, content->GetOriginalExpression(), -- cgit v0.12 From f20af79956bff9ddd0bf428a2731b9c817de93a1 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 21 Sep 2012 11:31:03 +0200 Subject: Handle colons as a special case in the generator expression parser. Like the special case for commas, this ensures that the colon only has special meaning as the delimiter between the identifier and the parameters of a particular expression, but constructs such as INCLUDE_DIRECTORIES "$<1:C:\foo>" are legal. --- Source/cmGeneratorExpressionParser.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/cmGeneratorExpressionParser.cxx b/Source/cmGeneratorExpressionParser.cxx index 2a5cc7a..d3c4aa3 100644 --- a/Source/cmGeneratorExpressionParser.cxx +++ b/Source/cmGeneratorExpressionParser.cxx @@ -127,6 +127,11 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression( parameters.resize(parameters.size() + 1); ++this->it; } + if (this->it->TokenType == cmGeneratorExpressionToken::ColonSeparator) + { + extendText(*(parameters.end() - 1), this->it); + ++this->it; + } if (this->it == this->Tokens.end()) { break; -- cgit v0.12