GenEx: Create cmGeneratorTargets for imported targets.

We're going to need to link to them, and all the linking API is moving
to cmGeneratorTarget.

Skip imported targets when iterating over cmGeneratorTargets in places
where we only want targets we build.  The GetGeneratorTargets result now
includes IMPORTED targets where it didn't before.  The GetTargets
result, which was what used to be called in these methods does not
include IMPORTED targets.  This doesn't relate to any known bugs, but in
some future uses of GetGeneratorTargets it will be important, so
starting the convention and being deliberate now is a good idea.
This commit is contained in:
Stephen Kelly 2012-10-10 00:07:34 +02:00 committed by Brad King
parent 04421042b3
commit 95d590ddba
3 changed files with 18 additions and 0 deletions

View File

@ -889,6 +889,10 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
for (cmGeneratorTargetsType::iterator l = targets.begin();
l != targets.end(); ++l)
{
if (l->first->IsImported())
{
continue;
}
std::vector<std::string> includeDirs;
const char *config = mf->GetDefinition("CMAKE_BUILD_TYPE");
(*it)->GetIncludeDirectories(includeDirs, l->second, "C", config);

View File

@ -1108,6 +1108,16 @@ void cmGlobalGenerator::CreateGeneratorTargets()
this->ComputeTargetObjects(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);
}
}

View File

@ -745,6 +745,10 @@ void cmLocalGenerator
for(cmGeneratorTargetsType::iterator l = tgts.begin();
l != tgts.end(); l++)
{
if (l->first->IsImported())
{
continue;
}
cmGeneratorTarget& target = *l->second;
switch(target.GetType())
{