From d8a59ea4b370eaf4a5b6162631af9e272fdb24b4 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 27 Oct 2012 16:16:17 +0200 Subject: [PATCH] Port cmGeneratorExpression to cmTarget from cmGeneratorTarget. Following from the discussion here: http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/3615/focus=5170 (Re: Generator expressisons in target properties, 26 Oct 12:10) we can't split cmTarget API for linking into cmGeneratorTarget. In the future we will probably also need to move the include and compile definitions API back to cmTarget so that it can be used by export(). --- Source/cmGeneratorExpression.cxx | 2 +- Source/cmGeneratorExpression.h | 3 +-- Source/cmGeneratorExpressionEvaluator.cxx | 4 ++-- Source/cmGeneratorExpressionEvaluator.h | 3 +-- Source/cmGeneratorTarget.cxx | 4 ++-- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 7d8df3733..32bf941eb 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -68,7 +68,7 @@ cmGeneratorExpression::~cmGeneratorExpression() //---------------------------------------------------------------------------- const char *cmCompiledGeneratorExpression::Evaluate( cmMakefile* mf, const char* config, bool quiet, - cmGeneratorTarget *target, + cmTarget *target, cmGeneratorExpressionDAGChecker *dagChecker) const { if (!this->NeedsParsing) diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index 29d3f444f..ea3e7d03b 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -20,7 +20,6 @@ #include class cmTarget; -class cmGeneratorTarget; class cmMakefile; class cmListFileBacktrace; @@ -68,7 +67,7 @@ class cmCompiledGeneratorExpression public: const char* Evaluate(cmMakefile* mf, const char* config, bool quiet = false, - cmGeneratorTarget *target = 0, + cmTarget *target = 0, cmGeneratorExpressionDAGChecker *dagChecker = 0) const; /** Get set of targets found during evaluations. */ diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 2e123a4d9..c60900034 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -287,7 +287,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode cmsys::RegularExpression propertyNameValidator; propertyNameValidator.compile("^[A-Za-z0-9_]+$"); - cmGeneratorTarget* target = context->Target; + cmTarget* target = context->Target; std::string propertyName = *parameters.begin(); if (parameters.size() == 2) { @@ -320,7 +320,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode "Target name not supported."); return std::string(); } - target = context->Makefile->FindGeneratorTargetToUse( + target = context->Makefile->FindTargetToUse( targetName.c_str()); if (!target) diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h index 04a2acdc6..d37337ef5 100644 --- a/Source/cmGeneratorExpressionEvaluator.h +++ b/Source/cmGeneratorExpressionEvaluator.h @@ -18,7 +18,6 @@ #include "cmListFileCache.h" class cmTarget; -class cmGeneratorTarget; //---------------------------------------------------------------------------- struct cmGeneratorExpressionContext @@ -27,7 +26,7 @@ struct cmGeneratorExpressionContext std::set Targets; cmMakefile *Makefile; const char *Config; - cmGeneratorTarget *Target; + cmTarget *Target; bool Quiet; bool HadError; }; diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 19b55c62c..a68abca2f 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -308,7 +308,7 @@ std::vector cmGeneratorTarget::GetIncludeDirectories( .Evaluate(this->Makefile, config, false, - this, + this->Target, &dagChecker), includes); @@ -356,6 +356,6 @@ std::string cmGeneratorTarget::GetCompileDefinitions(const char *config) return ge.Parse(prop).Evaluate(this->Makefile, config, false, - this, + this->Target, &dagChecker); }