Commit b003f56f authored by Brad King's avatar Brad King 💬 Committed by Kitware Robot
Browse files

Merge topic 'fix-find-package-mode'

a7f393dc cmake: Future-proof --find-package mode.
parents 0eadf205 a7f393dc
......@@ -1374,36 +1374,38 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
}
}
//----------------------------------------------------------------------------
void cmGlobalGenerator::CreateGeneratorTargets(cmMakefile *mf)
{
cmGeneratorTargetsType generatorTargets;
cmTargets& targets = mf->GetTargets();
for(cmTargets::iterator ti = targets.begin();
ti != targets.end(); ++ti)
{
cmTarget* t = &ti->second;
cmGeneratorTarget* gt = new cmGeneratorTarget(t);
this->GeneratorTargets[t] = gt;
generatorTargets[t] = gt;
}
for(std::vector<cmTarget*>::const_iterator
j = mf->GetOwnedImportedTargets().begin();
j != mf->GetOwnedImportedTargets().end(); ++j)
{
cmGeneratorTarget* gt = new cmGeneratorTarget(*j);
this->GeneratorTargets[*j] = gt;
generatorTargets[*j] = gt;
}
mf->SetGeneratorTargets(generatorTargets);
}
//----------------------------------------------------------------------------
void cmGlobalGenerator::CreateGeneratorTargets()
{
// Construct per-target generator information.
for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
{
cmGeneratorTargetsType generatorTargets;
cmMakefile *mf = this->LocalGenerators[i]->GetMakefile();
cmTargets& targets = mf->GetTargets();
for(cmTargets::iterator ti = targets.begin();
ti != targets.end(); ++ti)
{
cmTarget* t = &ti->second;
cmGeneratorTarget* gt = new cmGeneratorTarget(t);
this->GeneratorTargets[t] = gt;
generatorTargets[t] = gt;
}
for(std::vector<cmTarget*>::const_iterator
j = mf->GetOwnedImportedTargets().begin();
j != mf->GetOwnedImportedTargets().end(); ++j)
{
cmGeneratorTarget* gt = new cmGeneratorTarget(*j);
this->GeneratorTargets[*j] = gt;
generatorTargets[*j] = gt;
}
mf->SetGeneratorTargets(generatorTargets);
this->CreateGeneratorTargets(this->LocalGenerators[i]->GetMakefile());
}
}
......
......@@ -432,6 +432,8 @@ private:
// Per-target generator information.
cmGeneratorTargetsType GeneratorTargets;
friend class cmake;
void CreateGeneratorTargets(cmMakefile* mf);
void CreateGeneratorTargets();
void ComputeGeneratorTargetObjects();
virtual void ComputeTargetObjects(cmGeneratorTarget* gt) const;
......
......@@ -593,9 +593,10 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
std::string linkPath;
std::string flags;
std::string linkFlags;
cmGeneratorTarget gtgt(tgt);
gg->CreateGeneratorTargets(mf);
cmGeneratorTarget *gtgt = gg->GetGeneratorTarget(tgt);
lg->GetTargetFlags(linkLibs, frameworkPath, linkPath, flags, linkFlags,
&gtgt);
gtgt);
linkLibs = frameworkPath + linkPath + linkLibs;
printf("%s\n", linkLibs.c_str() );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment