2016-09-27 22:01:08 +03:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2015-02-23 01:32:11 +03:00
|
|
|
#ifndef cmGeneratorExpressionNode_h
|
|
|
|
#define cmGeneratorExpressionNode_h
|
|
|
|
|
2016-09-01 21:59:28 +03:00
|
|
|
#include <cmConfigure.h> // IWYU pragma: keep
|
2016-04-29 16:40:20 +03:00
|
|
|
|
2016-09-01 21:59:28 +03:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2015-02-23 01:32:11 +03:00
|
|
|
|
2016-09-01 21:59:28 +03:00
|
|
|
class cmGeneratorTarget;
|
|
|
|
class cmLocalGenerator;
|
|
|
|
struct GeneratorExpressionContent;
|
|
|
|
struct cmGeneratorExpressionContext;
|
|
|
|
struct cmGeneratorExpressionDAGChecker;
|
2015-02-23 01:32:11 +03:00
|
|
|
|
|
|
|
struct cmGeneratorExpressionNode
|
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
enum
|
|
|
|
{
|
2015-02-23 01:32:11 +03:00
|
|
|
DynamicParameters = 0,
|
|
|
|
OneOrMoreParameters = -1,
|
|
|
|
OneOrZeroParameters = -2
|
|
|
|
};
|
|
|
|
virtual ~cmGeneratorExpressionNode() {}
|
|
|
|
|
|
|
|
virtual bool GeneratesContent() const { return true; }
|
|
|
|
|
|
|
|
virtual bool RequiresLiteralInput() const { return false; }
|
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
virtual bool AcceptsArbitraryContentParameter() const { return false; }
|
2015-02-23 01:32:11 +03:00
|
|
|
|
|
|
|
virtual int NumExpectedParameters() const { return 1; }
|
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
virtual std::string Evaluate(
|
|
|
|
const std::vector<std::string>& parameters,
|
|
|
|
cmGeneratorExpressionContext* context,
|
|
|
|
const GeneratorExpressionContent* content,
|
|
|
|
cmGeneratorExpressionDAGChecker* dagChecker) const = 0;
|
2015-02-23 01:32:11 +03:00
|
|
|
|
|
|
|
static std::string EvaluateDependentExpression(
|
2016-05-16 17:34:04 +03:00
|
|
|
std::string const& prop, cmLocalGenerator* lg,
|
|
|
|
cmGeneratorExpressionContext* context, const cmGeneratorTarget* headTarget,
|
2015-09-16 05:38:52 +03:00
|
|
|
const cmGeneratorTarget* currentTarget,
|
2016-05-16 17:34:04 +03:00
|
|
|
cmGeneratorExpressionDAGChecker* dagChecker);
|
2015-02-23 01:32:11 +03:00
|
|
|
|
|
|
|
static const cmGeneratorExpressionNode* GetNode(
|
2016-05-16 17:34:04 +03:00
|
|
|
const std::string& identifier);
|
2015-02-23 01:32:11 +03:00
|
|
|
};
|
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
void reportError(cmGeneratorExpressionContext* context,
|
|
|
|
const std::string& expr, const std::string& result);
|
2015-02-23 01:32:11 +03:00
|
|
|
|
|
|
|
#endif
|