Merge topic 'cmGeneratorTarget-exports'

d945b36a cmExportTryCompileFileGenerator: Evaluate genex with cmGeneratorTarget.
48f8b6ac cmExportFileGenerator: Evaluate genex with cmGeneratorTarget.
This commit is contained in:
Brad King 2015-10-06 10:59:13 -04:00 committed by CMake Topic Stage
commit 256bf8876a
2 changed files with 14 additions and 8 deletions

View File

@ -436,7 +436,9 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
ImportPropertyMap &properties, ImportPropertyMap &properties,
std::vector<std::string> &missingTargets) std::vector<std::string> &missingTargets)
{ {
cmTarget *target = tei->Target; cmGeneratorTarget *target = tei->Target->GetMakefile()
->GetGlobalGenerator()
->GetGeneratorTarget(tei->Target);
assert(preprocessRule == cmGeneratorExpression::InstallInterface); assert(preprocessRule == cmGeneratorExpression::InstallInterface);
const char *propName = "INTERFACE_INCLUDE_DIRECTORIES"; const char *propName = "INTERFACE_INCLUDE_DIRECTORIES";
@ -450,12 +452,12 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
true); true);
this->ReplaceInstallPrefix(dirs); this->ReplaceInstallPrefix(dirs);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(dirs); cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(dirs);
std::string exportDirs = cge->Evaluate(target->GetMakefile(), "", std::string exportDirs = cge->Evaluate(target->Target->GetMakefile(), "",
false, target); false, target->Target);
if (cge->GetHadContextSensitiveCondition()) if (cge->GetHadContextSensitiveCondition())
{ {
cmMakefile* mf = target->GetMakefile(); cmMakefile* mf = target->Target->GetMakefile();
std::ostringstream e; std::ostringstream e;
e << "Target \"" << target->GetName() << "\" is installed with " e << "Target \"" << target->GetName() << "\" is installed with "
"INCLUDES DESTINATION set to a context sensitive path. Paths which " "INCLUDES DESTINATION set to a context sensitive path. Paths which "
@ -486,10 +488,10 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
true); true);
if (!prepro.empty()) if (!prepro.empty())
{ {
this->ResolveTargetsInGeneratorExpressions(prepro, target, this->ResolveTargetsInGeneratorExpressions(prepro, target->Target,
missingTargets); missingTargets);
if (!checkInterfaceDirs(prepro, target, propName)) if (!checkInterfaceDirs(prepro, target->Target, propName))
{ {
return; return;
} }

View File

@ -76,8 +76,12 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
dummyHead.SetType(cmTarget::EXECUTABLE, "try_compile_dummy_exe"); dummyHead.SetType(cmTarget::EXECUTABLE, "try_compile_dummy_exe");
dummyHead.SetMakefile(tgt->GetMakefile()); dummyHead.SetMakefile(tgt->GetMakefile());
std::string result = cge->Evaluate(tgt->GetMakefile(), this->Config, cmGeneratorTarget* gtgt =
false, &dummyHead, tgt, &dagChecker); tgt->GetMakefile()->GetGlobalGenerator()->GetGeneratorTarget(tgt);
std::string result = cge->Evaluate(gtgt->Target->GetMakefile(), this->Config,
false, &dummyHead,
gtgt->Target, &dagChecker);
const std::set<cmTarget const*> &allTargets = cge->GetAllTargetsSeen(); const std::set<cmTarget const*> &allTargets = cge->GetAllTargetsSeen();
for(std::set<cmTarget const*>::const_iterator li = allTargets.begin(); for(std::set<cmTarget const*>::const_iterator li = allTargets.begin();