diff options
author | Stephen Kelly <steveire@gmail.com> | 2012-11-26 21:43:13 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-11-27 14:12:39 (GMT) |
commit | 07749e3705cfc0105399c4a7a8349ec9f83ba39c (patch) | |
tree | 204a97eccfbf03864d61459876ee301dbdb40010 /Source/cmGeneratorExpressionEvaluator.cxx | |
parent | ee96dc76864b899684d62b51edd87d3083e80168 (diff) | |
download | CMake-07749e3705cfc0105399c4a7a8349ec9f83ba39c.zip CMake-07749e3705cfc0105399c4a7a8349ec9f83ba39c.tar.gz CMake-07749e3705cfc0105399c4a7a8349ec9f83ba39c.tar.bz2 |
Genex: Ensure that $<0:...> has a parameter.
Diffstat (limited to 'Source/cmGeneratorExpressionEvaluator.cxx')
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 23f641d..3c2f7c5 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -66,6 +66,8 @@ static const struct ZeroNode : public cmGeneratorExpressionNode virtual bool GeneratesContent() const { return false; } + virtual bool AcceptsSingleArbitraryContentParameter() const { return true; } + std::string Evaluate(const std::vector<std::string> &, cmGeneratorExpressionContext *, const GeneratorExpressionContent *, @@ -642,6 +644,20 @@ std::string GeneratorExpressionContent::Evaluate( if (!node->GeneratesContent()) { + if (node->AcceptsSingleArbitraryContentParameter()) + { + if (this->ParamChildren.empty()) + { + reportError(context, this->GetOriginalExpression(), + "$<" + identifier + "> expression requires a parameter."); + } + } + else + { + std::vector<std::string> parameters; + this->EvaluateParameters(node, identifier, context, dagChecker, + parameters); + } return std::string(); } |