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().
This commit is contained in:
Stephen Kelly 2012-10-27 16:16:17 +02:00
parent 8faf4e9380
commit d8a59ea4b3
5 changed files with 7 additions and 9 deletions

View File

@ -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)

View File

@ -20,7 +20,6 @@
#include <cmsys/RegularExpression.hxx>
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. */

View File

@ -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)

View File

@ -18,7 +18,6 @@
#include "cmListFileCache.h"
class cmTarget;
class cmGeneratorTarget;
//----------------------------------------------------------------------------
struct cmGeneratorExpressionContext
@ -27,7 +26,7 @@ struct cmGeneratorExpressionContext
std::set<cmTarget*> Targets;
cmMakefile *Makefile;
const char *Config;
cmGeneratorTarget *Target;
cmTarget *Target;
bool Quiet;
bool HadError;
};

View File

@ -308,7 +308,7 @@ std::vector<std::string> 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);
}