diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 2e123a4d91..23f641d641 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -677,6 +677,23 @@ std::string GeneratorExpressionContent::Evaluate( } std::vector parameters; + this->EvaluateParameters(node, identifier, context, dagChecker, parameters); + if (context->HadError) + { + return std::string(); + } + + return node->Evaluate(parameters, context, this, dagChecker); +} + +//---------------------------------------------------------------------------- +std::string GeneratorExpressionContent::EvaluateParameters( + const cmGeneratorExpressionNode *node, + const std::string &identifier, + cmGeneratorExpressionContext *context, + cmGeneratorExpressionDAGChecker *dagChecker, + std::vector ¶meters) const +{ { std::vector >::const_iterator pit = this->ParamChildren.begin(); @@ -732,10 +749,8 @@ std::string GeneratorExpressionContent::Evaluate( { reportError(context, this->GetOriginalExpression(), "$<" + identifier + "> expression requires at least one parameter."); - return std::string(); } - - return node->Evaluate(parameters, context, this, dagChecker); + return std::string(); } //---------------------------------------------------------------------------- diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h index 04a2acdc6b..642a02ee5d 100644 --- a/Source/cmGeneratorExpressionEvaluator.h +++ b/Source/cmGeneratorExpressionEvaluator.h @@ -33,6 +33,7 @@ struct cmGeneratorExpressionContext }; struct cmGeneratorExpressionDAGChecker; +struct cmGeneratorExpressionNode; //---------------------------------------------------------------------------- struct cmGeneratorExpressionEvaluator @@ -117,6 +118,13 @@ struct GeneratorExpressionContent : public cmGeneratorExpressionEvaluator ~GeneratorExpressionContent(); +private: + std::string EvaluateParameters(const cmGeneratorExpressionNode *node, + const std::string &identifier, + cmGeneratorExpressionContext *context, + cmGeneratorExpressionDAGChecker *dagChecker, + std::vector ¶meters) const; + private: std::vector IdentifierChildren; std::vector > ParamChildren;