summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionEvaluator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-12-10 10:33:23 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-01-05 00:05:09 (GMT)
commitb0c8f73eb62c5651b4a039f95676cae310bcada9 (patch)
tree43cc7d8a2db894cea68d8b5300cf3ee210e1f1a2 /Source/cmGeneratorExpressionEvaluator.cxx
parent77475fe61d0a1bbd562228bf66d5043bd001cb48 (diff)
downloadCMake-b0c8f73eb62c5651b4a039f95676cae310bcada9.zip
CMake-b0c8f73eb62c5651b4a039f95676cae310bcada9.tar.gz
CMake-b0c8f73eb62c5651b4a039f95676cae310bcada9.tar.bz2
Add the TARGET_NAME generator expression.
It will be used as a preprocessing marker.
Diffstat (limited to 'Source/cmGeneratorExpressionEvaluator.cxx')
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index a67cad5..c8f5b82 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -377,6 +377,28 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
} targetPropertyNode;
//----------------------------------------------------------------------------
+static const struct TargetNameNode : public cmGeneratorExpressionNode
+{
+ TargetNameNode() {}
+
+ virtual bool GeneratesContent() const { return true; }
+
+ virtual bool AcceptsSingleArbitraryContentParameter() const { return true; }
+ virtual bool RequiresLiteralInput() const { return true; }
+
+ std::string Evaluate(const std::vector<std::string> &parameters,
+ cmGeneratorExpressionContext *,
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ return parameters.front();
+ }
+
+ virtual int NumExpectedParameters() const { return 1; }
+
+} targetNameNode;
+
+//----------------------------------------------------------------------------
template<bool linker, bool soname>
struct TargetFilesystemArtifactResultCreator
{
@@ -601,6 +623,8 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier)
return &commaNode;
else if (identifier == "TARGET_PROPERTY")
return &targetPropertyNode;
+ else if (identifier == "TARGET_NAME")
+ return &targetNameNode;
else if (identifier == "BUILD_INTERFACE")
return &buildInterfaceNode;
else if (identifier == "INSTALL_INTERFACE")