cmGeneratorExpression: Port to cmLocalGenerator.

This commit is contained in:
Stephen Kelly 2015-07-25 16:56:52 +02:00
parent 1fdccff589
commit 11165525ba
21 changed files with 100 additions and 88 deletions

View File

@ -18,7 +18,7 @@ void cmCPackPropertiesGenerator::GenerateScriptForConfig(std::ostream& os,
const std::string& config, Indent const& indent)
{
std::string const& expandedFileName =
this->InstalledFile.GetNameExpression().Evaluate(this->LG->GetMakefile(),
this->InstalledFile.GetNameExpression().Evaluate(this->LG,
config);
cmInstalledFile::PropertyMapType const& properties =
@ -38,7 +38,7 @@ void cmCPackPropertiesGenerator::GenerateScriptForConfig(std::ostream& os,
j = property.ValueExpressions.begin();
j != property.ValueExpressions.end(); ++j)
{
std::string value = (*j)->Evaluate(LG->GetMakefile(), config);
std::string value = (*j)->Evaluate(this->LG, config);
os << " " << cmOutputConverter::EscapeForCMake(value);
}

View File

@ -50,8 +50,7 @@ std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
{
return target->GetLocation(this->Config);
}
return this->GE->Parse(argv0)->Evaluate(this->LG->GetMakefile(),
this->Config);
return this->GE->Parse(argv0)->Evaluate(this->LG, this->Config);
}
//----------------------------------------------------------------------------
@ -92,7 +91,7 @@ cmCustomCommandGenerator
for(unsigned int j=1;j < commandLine.size(); ++j)
{
std::string arg =
this->GE->Parse(commandLine[j])->Evaluate(this->LG->GetMakefile(),
this->GE->Parse(commandLine[j])->Evaluate(this->LG,
this->Config);
cmd += " ";
if(this->OldStyle)
@ -146,7 +145,7 @@ std::vector<std::string> const& cmCustomCommandGenerator::GetDepends() const
= this->GE->Parse(*i);
std::vector<std::string> result;
cmSystemTools::ExpandListArgument(
cge->Evaluate(this->LG->GetMakefile(), this->Config), result);
cge->Evaluate(this->LG, this->Config), result);
for (std::vector<std::string>::iterator it = result.begin();
it != result.end(); ++it)
{

View File

@ -456,7 +456,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
true);
this->ReplaceInstallPrefix(dirs);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(dirs);
std::string exportDirs = cge->Evaluate(target->Target->GetMakefile(), "",
std::string exportDirs = cge->Evaluate(target->GetLocalGenerator(), "",
false, target->Target);
if (cge->GetHadContextSensitiveCondition())

View File

@ -79,7 +79,7 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
cmGeneratorTarget* gtgt =
tgt->GetMakefile()->GetGlobalGenerator()->GetGeneratorTarget(tgt);
std::string result = cge->Evaluate(gtgt->Target->GetMakefile(), this->Config,
std::string result = cge->Evaluate(gtgt->GetLocalGenerator(), this->Config,
false, &dummyHead,
gtgt->Target, &dagChecker);

View File

@ -48,13 +48,13 @@ cmGeneratorExpression::~cmGeneratorExpression()
}
//----------------------------------------------------------------------------
const char *cmCompiledGeneratorExpression::Evaluate(
cmMakefile* mf, const std::string& config, bool quiet,
const char *cmCompiledGeneratorExpression::Evaluate(cmLocalGenerator* lg,
const std::string& config, bool quiet,
cmTarget const* headTarget,
cmGeneratorExpressionDAGChecker *dagChecker,
std::string const& language) const
{
return this->Evaluate(mf,
return this->Evaluate(lg,
config,
quiet,
headTarget,
@ -65,13 +65,13 @@ const char *cmCompiledGeneratorExpression::Evaluate(
//----------------------------------------------------------------------------
const char *cmCompiledGeneratorExpression::Evaluate(
cmMakefile* mf, const std::string& config, bool quiet,
cmLocalGenerator* lg, const std::string& config, bool quiet,
cmTarget const* headTarget,
cmTarget const* currentTarget,
cmGeneratorExpressionDAGChecker *dagChecker,
std::string const& language) const
{
cmGeneratorExpressionContext context(mf, config, quiet, headTarget,
cmGeneratorExpressionContext context(lg, config, quiet, headTarget,
currentTarget ? currentTarget : headTarget,
this->EvaluateForBuildsystem,
this->Backtrace, language);

View File

@ -20,7 +20,7 @@
#include <cmsys/auto_ptr.hxx>
class cmTarget;
class cmMakefile;
class cmLocalGenerator;
class cmListFileBacktrace;
struct cmGeneratorExpressionEvaluator;
@ -78,13 +78,13 @@ private:
class cmCompiledGeneratorExpression
{
public:
const char* Evaluate(cmMakefile* mf, const std::string& config,
const char* Evaluate(cmLocalGenerator* lg, const std::string& config,
bool quiet = false,
cmTarget const* headTarget = 0,
cmTarget const* currentTarget = 0,
cmGeneratorExpressionDAGChecker *dagChecker = 0,
std::string const& language = std::string()) const;
const char* Evaluate(cmMakefile* mf, const std::string& config,
const char* Evaluate(cmLocalGenerator* lg, const std::string& config,
bool quiet,
cmTarget const* headTarget,
cmGeneratorExpressionDAGChecker *dagChecker,

View File

@ -13,14 +13,14 @@
#include "cmGeneratorExpressionContext.h"
cmGeneratorExpressionContext::cmGeneratorExpressionContext(
cmMakefile* mf, std::string const& config,
cmLocalGenerator* lg, std::string const& config,
bool quiet, cmTarget const* headTarget,
cmTarget const* currentTarget,
bool evaluateForBuildsystem,
cmListFileBacktrace const& backtrace,
std::string const& language)
: Backtrace(backtrace),
Makefile(mf),
LG(lg),
Config(config),
Language(language),
HeadTarget(headTarget),

View File

@ -19,11 +19,12 @@
#include <string>
class cmTarget;
class cmLocalGenerator;
//----------------------------------------------------------------------------
struct cmGeneratorExpressionContext
{
cmGeneratorExpressionContext(cmMakefile* mf, std::string const& config,
cmGeneratorExpressionContext(cmLocalGenerator* lg, std::string const& config,
bool quiet, cmTarget const* headTarget,
cmTarget const* currentTarget,
bool evaluateForBuildsystem,
@ -38,7 +39,7 @@ struct cmGeneratorExpressionContext
std::set<cmTarget const*> SourceSensitiveTargets;
std::map<cmTarget const*, std::map<std::string, std::string> >
MaxLanguageStandard;
cmMakefile *Makefile;
cmLocalGenerator *LG;
std::string Config;
std::string Language;
cmTarget const* HeadTarget; // The target whose property is being evaluated.

View File

@ -13,6 +13,7 @@
#include "cmGeneratorExpressionDAGChecker.h"
#include "cmMakefile.h"
#include "cmLocalGenerator.h"
#include "cmAlgorithms.h"
//----------------------------------------------------------------------------
@ -110,7 +111,7 @@ void cmGeneratorExpressionDAGChecker::ReportError(
<< " " << expr << "\n"
<< "Self reference on target \""
<< context->HeadTarget->GetName() << "\".\n";
context->Makefile->GetCMakeInstance()
context->LG->GetCMakeInstance()
->IssueMessage(cmake::FATAL_ERROR, e.str(),
parent->Backtrace);
return;
@ -121,7 +122,7 @@ void cmGeneratorExpressionDAGChecker::ReportError(
e << "Error evaluating generator expression:\n"
<< " " << expr << "\n"
<< "Dependency loop found.";
context->Makefile->GetCMakeInstance()
context->LG->GetCMakeInstance()
->IssueMessage(cmake::FATAL_ERROR, e.str(),
context->Backtrace);
}
@ -134,7 +135,7 @@ void cmGeneratorExpressionDAGChecker::ReportError(
<< " "
<< (parent->Content ? parent->Content->GetOriginalExpression() : expr)
<< "\n";
context->Makefile->GetCMakeInstance()
context->LG->GetCMakeInstance()
->IssueMessage(cmake::FATAL_ERROR, e.str(),
parent->Backtrace);
parent = parent->Parent;

View File

@ -44,7 +44,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(cmLocalGenerator* lg,
std::string rawCondition = this->Condition->GetInput();
if (!rawCondition.empty())
{
std::string condResult = this->Condition->Evaluate(lg->GetMakefile(),
std::string condResult = this->Condition->Evaluate(lg,
config,
false, 0, 0, 0, lang);
if (condResult == "0")
@ -62,10 +62,10 @@ void cmGeneratorExpressionEvaluationFile::Generate(cmLocalGenerator* lg,
}
const std::string outputFileName
= this->OutputFileExpr->Evaluate(lg->GetMakefile(), config,
= this->OutputFileExpr->Evaluate(lg, config,
false, 0, 0, 0, lang);
const std::string outputContent
= inputExpression->Evaluate(lg->GetMakefile(),
= inputExpression->Evaluate(lg,
config,
false, 0, 0, 0, lang);
@ -110,7 +110,7 @@ void cmGeneratorExpressionEvaluationFile::CreateOutputFile(
for(std::vector<std::string>::const_iterator le = enabledLanguages.begin();
le != enabledLanguages.end(); ++le)
{
std::string name = this->OutputFileExpr->Evaluate(lg->GetMakefile(),
std::string name = this->OutputFileExpr->Evaluate(lg,
config,
false, 0, 0, 0, *le);
cmSourceFile* sf = lg->GetMakefile()->GetOrCreateSource(name);

View File

@ -17,7 +17,7 @@
//----------------------------------------------------------------------------
std::string cmGeneratorExpressionNode::EvaluateDependentExpression(
std::string const& prop, cmMakefile *makefile,
std::string const& prop, cmLocalGenerator *lg,
cmGeneratorExpressionContext *context,
cmTarget const* headTarget, cmTarget const* currentTarget,
cmGeneratorExpressionDAGChecker *dagChecker)
@ -25,7 +25,7 @@ std::string cmGeneratorExpressionNode::EvaluateDependentExpression(
cmGeneratorExpression ge(context->Backtrace);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
cge->SetEvaluateForBuildsystem(context->EvaluateForBuildsystem);
std::string result = cge->Evaluate(makefile,
std::string result = cge->Evaluate(lg,
context->Config,
context->Quiet,
headTarget,
@ -367,7 +367,8 @@ struct CompilerIdNode : public cmGeneratorExpressionNode
const std::string &lang) const
{
const char *compilerId =
context->Makefile->GetSafeDefinition("CMAKE_" + lang + "_COMPILER_ID");
context->LG->GetMakefile()
->GetSafeDefinition("CMAKE_" + lang + "_COMPILER_ID");
if (parameters.empty())
{
return compilerId ? compilerId : "";
@ -391,13 +392,13 @@ struct CompilerIdNode : public cmGeneratorExpressionNode
if (cmsysString_strcasecmp(parameters.begin()->c_str(), compilerId) == 0)
{
switch(context->Makefile->GetPolicyStatus(cmPolicies::CMP0044))
switch(context->LG->GetMakefile()->GetPolicyStatus(cmPolicies::CMP0044))
{
case cmPolicies::WARN:
{
std::ostringstream e;
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0044);
context->Makefile->GetCMakeInstance()
context->LG->GetCMakeInstance()
->IssueMessage(cmake::AUTHOR_WARNING,
e.str(), context->Backtrace);
}
@ -470,8 +471,9 @@ struct CompilerVersionNode : public cmGeneratorExpressionNode
cmGeneratorExpressionDAGChecker *,
const std::string &lang) const
{
const char *compilerVersion = context->Makefile->GetSafeDefinition(
"CMAKE_" + lang + "_COMPILER_VERSION");
const char *compilerVersion =
context->LG->GetMakefile()->GetSafeDefinition(
"CMAKE_" + lang + "_COMPILER_VERSION");
if (parameters.empty())
{
return compilerVersion ? compilerVersion : "";
@ -553,7 +555,7 @@ struct PlatformIdNode : public cmGeneratorExpressionNode
cmGeneratorExpressionDAGChecker *) const
{
const char *platformId =
context->Makefile->GetSafeDefinition("CMAKE_SYSTEM_NAME");
context->LG->GetMakefile()->GetSafeDefinition("CMAKE_SYSTEM_NAME");
if (parameters.empty())
{
return platformId ? platformId : "";
@ -768,7 +770,7 @@ static const struct CompileLanguageNode : public cmGeneratorExpressionNode
}
std::vector<std::string> enabledLanguages;
cmGlobalGenerator* gg = context->Makefile->GetGlobalGenerator();
cmGlobalGenerator* gg = context->LG->GetGlobalGenerator();
gg->GetEnabledLanguages(enabledLanguages);
if (!parameters.empty() &&
std::find(enabledLanguages.begin(), enabledLanguages.end(),
@ -858,7 +860,7 @@ getLinkedTargetsContent(
{
linkedTargetsContent =
cmGeneratorExpressionNode::EvaluateDependentExpression(depString,
target->Target->GetMakefile(),
target->GetLocalGenerator(),
context,
headTarget->Target,
target->Target, dagChecker);
@ -940,16 +942,17 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
}
if(propertyName == "ALIASED_TARGET")
{
if(context->Makefile->IsAlias(targetName))
if(context->LG->GetMakefile()->IsAlias(targetName))
{
if(cmTarget* tgt = context->Makefile->FindTargetToUse(targetName))
if(cmTarget* tgt =
context->LG->GetMakefile()->FindTargetToUse(targetName))
{
return tgt->GetName();
}
}
return "";
}
target = context->Makefile->FindTargetToUse(targetName);
target = context->LG->GetMakefile()->FindTargetToUse(targetName);
if (!target)
{
@ -994,7 +997,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
assert(target);
cmGeneratorTarget* gtgt =
context->Makefile->GetGlobalGenerator()->GetGeneratorTarget(target);
context->LG->GetGlobalGenerator()->GetGeneratorTarget(target);
if (propertyName == "LINKER_LANGUAGE")
{
@ -1099,7 +1102,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
"COMPILE_DEFINITIONS_"))
{
cmPolicies::PolicyStatus polSt =
context->Makefile->GetPolicyStatus(cmPolicies::CMP0043);
context->LG->GetMakefile()->GetPolicyStatus(cmPolicies::CMP0043);
if (polSt == cmPolicies::WARN || polSt == cmPolicies::OLD)
{
interfacePropertyName = "INTERFACE_COMPILE_DEFINITIONS";
@ -1112,7 +1115,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
if(isInterfaceProperty)
{
cmGeneratorTarget* gHeadTarget =
context->Makefile->GetGlobalGenerator()
context->LG->GetGlobalGenerator()
->GetGeneratorTarget(headTarget);
if(cmLinkInterfaceLibraries const* iface =
gtgt->GetLinkInterfaceLibraries(context->Config, gHeadTarget, true))
@ -1213,7 +1216,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
if(!interfacePropertyName.empty())
{
std::string result = this->EvaluateDependentExpression(prop,
context->Makefile, context,
context->LG, context,
headTarget, target, &dagChecker);
if (!linkedTargetsContent.empty())
{
@ -1269,7 +1272,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
std::string tgtName = parameters.front();
cmGeneratorTarget* gt =
context->Makefile->FindGeneratorTargetToUse(tgtName);
context->LG->GetMakefile()->FindGeneratorTargetToUse(tgtName);
if (!gt)
{
std::ostringstream e;
@ -1312,7 +1315,8 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
assert(!map_it->second.empty());
result += sep;
std::string objFile = obj_dir + map_it->second;
cmSourceFile* sf = context->Makefile->GetOrCreateSource(objFile, true);
cmSourceFile* sf =
context->LG->GetMakefile()->GetOrCreateSource(objFile, true);
sf->SetObjectLibrary(tgtName);
sf->SetProperty("EXTERNAL_OBJECT", "1");
result += objFile;
@ -1354,7 +1358,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
{
std::string error;
std::string lang;
if (!context->Makefile->CompileFeatureKnown(context->HeadTarget,
if (!context->LG->GetMakefile()->CompileFeatureKnown(context->HeadTarget,
*it, lang, &error))
{
reportError(context, content->GetOriginalExpression(), error);
@ -1365,7 +1369,8 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
if (availableFeatures.find(lang) == availableFeatures.end())
{
const char* featuresKnown
= context->Makefile->CompileFeaturesAvailable(lang, &error);
= context->LG->GetMakefile()->CompileFeaturesAvailable(lang,
&error);
if (!featuresKnown)
{
reportError(context, content->GetOriginalExpression(), error);
@ -1383,7 +1388,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
{
std::vector<std::string> const& langAvailable
= availableFeatures[lit->first];
const char* standardDefault = context->Makefile
const char* standardDefault = context->LG->GetMakefile()
->GetDefinition("CMAKE_" + lit->first + "_STANDARD_DEFAULT");
for (std::vector<std::string>::const_iterator it = lit->second.begin();
it != lit->second.end(); ++it)
@ -1399,7 +1404,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
// All features known for the language are always available.
continue;
}
if (!context->Makefile->HaveStandardAvailable(target,
if (!context->LG->GetMakefile()->HaveStandardAvailable(target,
lit->first, *it))
{
if (evalLL)
@ -1617,7 +1622,7 @@ struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
std::string pdbSupportVar = "CMAKE_" + language + "_LINKER_SUPPORTS_PDB";
if(!context->Makefile->IsOn(pdbSupportVar))
if(!context->LG->GetMakefile()->IsOn(pdbSupportVar))
{
::reportError(context, content->GetOriginalExpression(),
"TARGET_PDB_FILE is not supported by the target linker.");
@ -1731,7 +1736,7 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
return std::string();
}
cmGeneratorTarget* target =
context->Makefile->FindGeneratorTargetToUse(name);
context->LG->GetMakefile()->FindGeneratorTargetToUse(name);
if(!target)
{
::reportError(context, content->GetOriginalExpression(),
@ -1813,7 +1818,7 @@ static const struct ShellPathNode : public cmGeneratorExpressionNode
"\"" + parameters.front() + "\" is not an absolute path.");
return std::string();
}
cmOutputConverter converter(context->Makefile->GetStateSnapshot());
cmOutputConverter converter(context->LG->GetStateSnapshot());
return converter.ConvertDirectorySeparatorsForShell(parameters.front());
}
} shellPathNode;
@ -1897,7 +1902,7 @@ void reportError(cmGeneratorExpressionContext *context,
e << "Error evaluating generator expression:\n"
<< " " << expr << "\n"
<< result;
context->Makefile->GetCMakeInstance()
context->LG->GetCMakeInstance()
->IssueMessage(cmake::FATAL_ERROR, e.str(),
context->Backtrace);
}

View File

@ -54,7 +54,7 @@ struct cmGeneratorExpressionNode
) const = 0;
static std::string EvaluateDependentExpression(
std::string const& prop, cmMakefile *makefile,
std::string const& prop, cmLocalGenerator *lg,
cmGeneratorExpressionContext *context,
cmTarget const* headTarget, cmTarget const* currentTarget,
cmGeneratorExpressionDAGChecker *dagChecker);

View File

@ -453,7 +453,7 @@ std::string cmGeneratorTarget::GetOutputName(const std::string& config,
// Now evaluate genex and update the previously-prepared map entry.
cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(outName);
i->second = cge->Evaluate(this->Makefile, config);
i->second = cge->Evaluate(this->LocalGenerator, config);
}
else if(i->second.empty())
{
@ -510,7 +510,7 @@ cmGeneratorTarget::GetSourceDepends(cmSourceFile const* sf) const
return 0;
}
static void handleSystemIncludesDep(cmMakefile *mf,
static void handleSystemIncludesDep(cmLocalGenerator *lg,
cmGeneratorTarget const* depTgt,
const std::string& config,
cmGeneratorTarget const* headTarget,
@ -523,7 +523,7 @@ static void handleSystemIncludesDep(cmMakefile *mf,
{
cmGeneratorExpression ge;
cmSystemTools::ExpandListArgument(ge.Parse(dirs)
->Evaluate(mf,
->Evaluate(lg,
config, false, headTarget->Target,
depTgt->Target, dagChecker), result);
}
@ -537,7 +537,7 @@ static void handleSystemIncludesDep(cmMakefile *mf,
{
cmGeneratorExpression ge;
cmSystemTools::ExpandListArgument(ge.Parse(dirs)
->Evaluate(mf,
->Evaluate(lg,
config, false, headTarget->Target,
depTgt->Target, dagChecker), result);
}
@ -879,7 +879,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
{
cmGeneratorExpression ge;
cmSystemTools::ExpandListArgument(ge.Parse(*it)
->Evaluate(this->Makefile,
->Evaluate(this->LocalGenerator,
config, false, this->Target,
&dagChecker), result);
}
@ -889,7 +889,8 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
for(std::vector<cmGeneratorTarget const*>::const_iterator
li = deps.begin(), le = deps.end(); li != le; ++li)
{
handleSystemIncludesDep(this->Makefile, *li, config, this,
handleSystemIncludesDep(this->LocalGenerator, *li,
config, this,
&dagChecker, result, excludeImported);
}
@ -961,7 +962,8 @@ static bool processSources(cmGeneratorTarget const* tgt,
cmLinkImplItem const& item = (*it)->LinkImplItem;
std::string const& targetName = item;
std::vector<std::string> entrySources;
cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf,
cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(
tgt->GetLocalGenerator(),
config,
false,
tgt->Target,
@ -2054,7 +2056,7 @@ void cmGeneratorTarget::GetAutoUicOptions(std::vector<std::string> &result,
this->GetName(),
"AUTOUIC_OPTIONS", 0, 0);
cmSystemTools::ExpandListArgument(ge.Parse(prop)
->Evaluate(this->Makefile,
->Evaluate(this->LocalGenerator,
config,
false,
this->Target,
@ -2376,7 +2378,7 @@ cmTargetTraceDependencies
{
const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge
= ge.Parse(*cli);
cge->Evaluate(this->Makefile, "", true);
cge->Evaluate(this->GeneratorTarget->GetLocalGenerator(), "", true);
std::set<cmTarget*> geTargets = cge->GetTargets();
targets.insert(geTargets.begin(), geTargets.end());
}
@ -2530,8 +2532,6 @@ static void processIncludeDirectories(cmGeneratorTarget const* tgt,
const std::string& config, bool debugIncludes,
const std::string& language)
{
cmMakefile *mf = tgt->Target->GetMakefile();
for (std::vector<cmGeneratorTarget::TargetPropertyEntry*>::const_iterator
it = entries.begin(), end = entries.end(); it != end; ++it)
{
@ -2540,7 +2540,8 @@ static void processIncludeDirectories(cmGeneratorTarget const* tgt,
bool const fromImported = item.Target && item.Target->IsImported();
bool const checkCMP0027 = item.FromGenex;
std::vector<std::string> entryIncludes;
cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf,
cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(
tgt->GetLocalGenerator(),
config,
false,
tgt->Target,
@ -2746,13 +2747,12 @@ static void processCompileOptionsInternal(cmGeneratorTarget const* tgt,
const std::string& config, bool debugOptions, const char *logName,
std::string const& language)
{
cmMakefile *mf = tgt->Target->GetMakefile();
for (std::vector<cmGeneratorTarget::TargetPropertyEntry*>::const_iterator
it = entries.begin(), end = entries.end(); it != end; ++it)
{
std::vector<std::string> entryOptions;
cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf,
cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(
tgt->GetLocalGenerator(),
config,
false,
tgt->Target,
@ -4452,7 +4452,7 @@ void cmGeneratorTarget::ExpandLinkItems(std::string const& prop,
std::vector<std::string> libs;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
cmSystemTools::ExpandListArgument(cge->Evaluate(
this->Makefile,
this->LocalGenerator,
config,
false,
headTarget->Target,
@ -4777,7 +4777,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(config_outdir);
out = cge->Evaluate(this->Makefile, config);
out = cge->Evaluate(this->LocalGenerator, config);
// Skip per-configuration subdirectory.
conf = "";
@ -4788,7 +4788,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(outdir);
out = cge->Evaluate(this->Makefile, config);
out = cge->Evaluate(this->LocalGenerator, config);
// Skip per-configuration subdirectory if the value contained a
// generator expression.
@ -5347,7 +5347,8 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
cmsys::auto_ptr<cmCompiledGeneratorExpression> const cge =
ge.Parse(*le);
std::string const evaluated =
cge->Evaluate(this->Makefile, config, false, head->Target, &dagChecker);
cge->Evaluate(this->LocalGenerator, config, false,
head->Target, &dagChecker);
cmSystemTools::ExpandListArgument(evaluated, llibs);
if(cge->GetHadHeadSensitiveCondition())
{

View File

@ -1016,7 +1016,8 @@ cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression>
cge = ge.Parse(propertyValue);
if(cmSystemTools::IsOn(cge->Evaluate(target->GetMakefile(), *i)))
cmGeneratorTarget* gt = this->GetGeneratorTarget(target);
if(cmSystemTools::IsOn(cge->Evaluate(gt->GetLocalGenerator(), *i)))
{
activeConfigs.insert(*i);
}

View File

@ -2486,7 +2486,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
{
cmGeneratorExpression ge;
std::string processed = ge.Parse(i->second.GetValue())
->Evaluate(this->CurrentMakefile, configName);
->Evaluate(this->CurrentLocalGenerator, configName);
buildSettings->AddAttribute(attribute.c_str(),
this->CreateString(processed));
}

View File

@ -97,5 +97,5 @@ cmInstallDirectoryGenerator::GetDestination(std::string const& config) const
{
cmGeneratorExpression ge;
return ge.Parse(this->Destination)
->Evaluate(this->LocalGenerator->GetMakefile(), config);
->Evaluate(this->LocalGenerator, config);
}

View File

@ -68,7 +68,7 @@ cmInstallFilesGenerator::GetDestination(std::string const& config) const
{
cmGeneratorExpression ge;
return ge.Parse(this->Destination)
->Evaluate(this->LocalGenerator->GetMakefile(), config);
->Evaluate(this->LocalGenerator, config);
}
//----------------------------------------------------------------------------
@ -117,7 +117,7 @@ void cmInstallFilesGenerator::GenerateScriptForConfig(std::ostream& os,
{
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*i);
cmSystemTools::ExpandListArgument(cge->Evaluate(
this->LocalGenerator->GetMakefile(), config), files);
this->LocalGenerator, config), files);
}
this->AddFilesInstallRule(os, config, indent, files);
}

View File

@ -351,7 +351,7 @@ cmInstallTargetGenerator::GetDestination(std::string const& config) const
{
cmGeneratorExpression ge;
return ge.Parse(this->Destination)
->Evaluate(this->Target->Target->GetMakefile(), config);
->Evaluate(this->Target->GetLocalGenerator(), config);
}
//----------------------------------------------------------------------------

View File

@ -147,7 +147,8 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(additional_clean_files);
cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile, config,
cmSystemTools::ExpandListArgument(cge->Evaluate(this->LocalGenerator,
config,
false, this->Target, 0, 0),
this->CleanFiles);
}

View File

@ -117,7 +117,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
else
{
// Use the command name given.
exe = ge.Parse(exe.c_str())->Evaluate(this->LG->GetMakefile(), config);
exe = ge.Parse(exe.c_str())->Evaluate(this->LG, config);
cmSystemTools::ConvertToUnixSlashes(exe);
}
@ -128,7 +128,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
{
os << " " << cmOutputConverter::EscapeForCMake(
ge.Parse(*ci)->Evaluate(
this->LG->GetMakefile(), config));
this->LG, config));
}
// Finish the test command.
@ -145,7 +145,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
{
os << " " << i->first
<< " " << cmOutputConverter::EscapeForCMake(
ge.Parse(i->second.GetValue())->Evaluate(this->LG->GetMakefile(),
ge.Parse(i->second.GetValue())->Evaluate(this->LG,
config));
}
os << ")" << std::endl;

View File

@ -1370,7 +1370,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
}
for(size_t i = 0; i != this->Configurations.size(); ++i)
{
if(0 == strcmp(cge->Evaluate(this->Makefile,
if(0 == strcmp(cge->Evaluate(this->LocalGenerator,
this->Configurations[i]), "1"))
{
this->WriteString("<DeploymentContent Condition=\""
@ -2301,7 +2301,8 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(nativeLibDirectoriesExpression);
std::string nativeLibDirs = cge->Evaluate(this->Makefile, configName);
std::string nativeLibDirs = cge->Evaluate(this->LocalGenerator,
configName);
this->WriteString("<NativeLibDirectories>", 3);
(*this->BuildFileStream) << cmVS10EscapeXML(nativeLibDirs) <<
"</NativeLibDirectories>\n";
@ -2313,7 +2314,8 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(nativeLibDependenciesExpression);
std::string nativeLibDeps = cge->Evaluate(this->Makefile, configName);
std::string nativeLibDeps = cge->Evaluate(this->LocalGenerator,
configName);
this->WriteString("<NativeLibDependencies>", 3);
(*this->BuildFileStream) << cmVS10EscapeXML(nativeLibDeps) <<
"</NativeLibDependencies>\n";
@ -2333,7 +2335,8 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
cmGeneratorExpression ge;
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(jarDirectoriesExpression);
std::string jarDirectories = cge->Evaluate(this->Makefile, configName);
std::string jarDirectories = cge->Evaluate(this->LocalGenerator,
configName);
this->WriteString("<JarDirectories>", 3);
(*this->BuildFileStream) << cmVS10EscapeXML(jarDirectories) <<
"</JarDirectories>\n";