cmLocalGenerator: Store a vector of generator targets.

Not a map from cmTarget to cmGeneratorTarget.
This commit is contained in:
Stephen Kelly 2015-10-18 16:53:00 +02:00
parent e4b7d5afde
commit a8c0fbcc19
15 changed files with 92 additions and 90 deletions

View File

@ -965,13 +965,13 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
it != this->GlobalGenerator->GetLocalGenerators().end(); it != this->GlobalGenerator->GetLocalGenerators().end();
++it) ++it)
{ {
cmGeneratorTargetsType targets = (*it)->GetGeneratorTargets(); std::vector<cmGeneratorTarget*> targets = (*it)->GetGeneratorTargets();
for (cmGeneratorTargetsType::iterator l = targets.begin(); for (std::vector<cmGeneratorTarget*>::iterator l = targets.begin();
l != targets.end(); ++l) l != targets.end(); ++l)
{ {
std::vector<std::string> includeDirs; std::vector<std::string> includeDirs;
std::string config = mf->GetSafeDefinition("CMAKE_BUILD_TYPE"); std::string config = mf->GetSafeDefinition("CMAKE_BUILD_TYPE");
(*it)->GetIncludeDirectories(includeDirs, l->second, "C", config); (*it)->GetIncludeDirectories(includeDirs, *l, "C", config);
this->AppendIncludeDirectories(fout, includeDirs, emmited); this->AppendIncludeDirectories(fout, includeDirs, emmited);
} }
} }

View File

@ -1584,7 +1584,7 @@ void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes,
cmTarget* t = &ti->second; cmTarget* t = &ti->second;
cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg); cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg);
this->GeneratorTargets[t] = gt; this->GeneratorTargets[t] = gt;
lg->AddGeneratorTarget(t, gt); lg->AddGeneratorTarget(gt);
} }
} }

View File

@ -287,8 +287,8 @@ void cmGlobalGhsMultiGenerator::Generate()
{ {
cmLocalGhsMultiGenerator *lg = cmLocalGhsMultiGenerator *lg =
static_cast<cmLocalGhsMultiGenerator *>(this->LocalGenerators[i]); static_cast<cmLocalGhsMultiGenerator *>(this->LocalGenerators[i]);
cmGeneratorTargetsType tgts = lg->GetGeneratorTargets(); std::vector<cmGeneratorTarget*> tgts = lg->GetGeneratorTargets();
this->UpdateBuildFiles(&tgts); this->UpdateBuildFiles(tgts);
} }
} }
@ -481,15 +481,15 @@ cmGlobalGhsMultiGenerator::GetFileNameFromPath(std::string const &path)
} }
void cmGlobalGhsMultiGenerator::UpdateBuildFiles( void cmGlobalGhsMultiGenerator::UpdateBuildFiles(
cmGeneratorTargetsType *tgts) std::vector<cmGeneratorTarget*> tgts)
{ {
for (cmGeneratorTargetsType::iterator tgtsI = tgts->begin(); for (std::vector<cmGeneratorTarget*>::iterator tgtsI = tgts.begin();
tgtsI != tgts->end(); ++tgtsI) tgtsI != tgts.end(); ++tgtsI)
{ {
const cmTarget *tgt(tgtsI->first); const cmGeneratorTarget *tgt = *tgtsI;
if (IsTgtForBuild(tgt)) if (IsTgtForBuild(tgt->Target))
{ {
char const *rawFolderName = tgtsI->first->GetProperty("FOLDER"); char const *rawFolderName = tgt->GetProperty("FOLDER");
if (NULL == rawFolderName) if (NULL == rawFolderName)
{ {
rawFolderName = ""; rawFolderName = "";
@ -504,13 +504,13 @@ void cmGlobalGhsMultiGenerator::UpdateBuildFiles(
GhsMultiGpj::PROJECT); GhsMultiGpj::PROJECT);
} }
std::vector<cmsys::String> splitPath = cmSystemTools::SplitString( std::vector<cmsys::String> splitPath = cmSystemTools::SplitString(
cmGhsMultiTargetGenerator::GetRelBuildFileName(tgt)); cmGhsMultiTargetGenerator::GetRelBuildFileName(tgt->Target));
std::string foldNameRelBuildFile(*(splitPath.end() - 2) + "/" + std::string foldNameRelBuildFile(*(splitPath.end() - 2) + "/" +
splitPath.back()); splitPath.back());
*this->TargetFolderBuildStreams[folderName] << foldNameRelBuildFile *this->TargetFolderBuildStreams[folderName] << foldNameRelBuildFile
<< " "; << " ";
GhsMultiGpj::WriteGpjTag(cmGhsMultiTargetGenerator::GetGpjTag( GhsMultiGpj::WriteGpjTag(cmGhsMultiTargetGenerator::GetGpjTag(
tgtsI->second), tgt),
this->TargetFolderBuildStreams[folderName]); this->TargetFolderBuildStreams[folderName]);
} }
} }

View File

@ -110,7 +110,7 @@ private:
std::vector<cmsys::String>::const_iterator end, std::vector<cmsys::String>::const_iterator end,
GhsMultiGpj::Types projType); GhsMultiGpj::Types projType);
static std::string GetFileNameFromPath(std::string const &path); static std::string GetFileNameFromPath(std::string const &path);
void UpdateBuildFiles(cmGeneratorTargetsType *tgts); void UpdateBuildFiles(std::vector<cmGeneratorTarget*> tgts);
bool IsTgtForBuild(const cmTarget *tgt); bool IsTgtForBuild(const cmTarget *tgt);
std::vector<cmGeneratedFileStream *> TargetSubProjects; std::vector<cmGeneratedFileStream *> TargetSubProjects;

View File

@ -68,13 +68,14 @@ void cmGlobalKdevelopGenerator::Generate()
for (std::vector<cmLocalGenerator*>::const_iterator lg=lgs.begin(); for (std::vector<cmLocalGenerator*>::const_iterator lg=lgs.begin();
lg!=lgs.end(); lg++) lg!=lgs.end(); lg++)
{ {
cmGeneratorTargetsType const& targets = (*lg)->GetGeneratorTargets(); std::vector<cmGeneratorTarget*> const& targets =
for (cmGeneratorTargetsType::const_iterator ti = targets.begin(); (*lg)->GetGeneratorTargets();
ti != targets.end(); ti++) for (std::vector<cmGeneratorTarget*>::const_iterator ti =
targets.begin(); ti != targets.end(); ti++)
{ {
if (ti->second->GetType()==cmState::EXECUTABLE) if ((*ti)->GetType()==cmState::EXECUTABLE)
{ {
executable = ti->second->GetLocation(""); executable = (*ti)->GetLocation("");
break; break;
} }
} }

View File

@ -460,11 +460,11 @@ cmGlobalUnixMakefileGenerator3
// The directory-level rule should depend on the target-level rules // The directory-level rule should depend on the target-level rules
// for all targets in the directory. // for all targets in the directory.
std::vector<std::string> depends; std::vector<std::string> depends;
cmGeneratorTargetsType targets = lg->GetGeneratorTargets(); std::vector<cmGeneratorTarget*> targets = lg->GetGeneratorTargets();
for(cmGeneratorTargetsType::iterator l = targets.begin(); for(std::vector<cmGeneratorTarget*>::iterator l = targets.begin();
l != targets.end(); ++l) l != targets.end(); ++l)
{ {
cmGeneratorTarget* gtarget = l->second; cmGeneratorTarget* gtarget = *l;
int type = gtarget->GetType(); int type = gtarget->GetType();
if((type == cmState::EXECUTABLE) || if((type == cmState::EXECUTABLE) ||
(type == cmState::STATIC_LIBRARY) || (type == cmState::STATIC_LIBRARY) ||
@ -623,11 +623,11 @@ cmGlobalUnixMakefileGenerator3
lg = static_cast<cmLocalUnixMakefileGenerator3 *> lg = static_cast<cmLocalUnixMakefileGenerator3 *>
(this->LocalGenerators[i]); (this->LocalGenerators[i]);
// for each target Generate the rule files for each target. // for each target Generate the rule files for each target.
cmGeneratorTargetsType targets = lg->GetGeneratorTargets(); std::vector<cmGeneratorTarget*> targets = lg->GetGeneratorTargets();
for(cmGeneratorTargetsType::iterator t = targets.begin(); for(std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
t != targets.end(); ++t) t != targets.end(); ++t)
{ {
cmGeneratorTarget* gtarget = t->second; cmGeneratorTarget* gtarget = *t;
// Don't emit the same rule twice (e.g. two targets with the same // Don't emit the same rule twice (e.g. two targets with the same
// simple name) // simple name)
int type = gtarget->GetType(); int type = gtarget->GetType();
@ -720,11 +720,11 @@ cmGlobalUnixMakefileGenerator3
depends.push_back("cmake_check_build_system"); depends.push_back("cmake_check_build_system");
// for each target Generate the rule files for each target. // for each target Generate the rule files for each target.
cmGeneratorTargetsType targets = lg->GetGeneratorTargets(); std::vector<cmGeneratorTarget*> targets = lg->GetGeneratorTargets();
for(cmGeneratorTargetsType::iterator t = targets.begin(); for(std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
t != targets.end(); ++t) t != targets.end(); ++t)
{ {
cmGeneratorTarget* gtarget = t->second; cmGeneratorTarget* gtarget = *t;
int type = gtarget->GetType(); int type = gtarget->GetType();
std::string name = gtarget->GetName(); std::string name = gtarget->GetName();
if (!name.empty() if (!name.empty()

View File

@ -256,7 +256,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
noCommandLines); noCommandLines);
cmGeneratorTarget* gt = new cmGeneratorTarget(tgt, lg); cmGeneratorTarget* gt = new cmGeneratorTarget(tgt, lg);
lg->AddGeneratorTarget(tgt, gt); lg->AddGeneratorTarget(gt);
this->AddGeneratorTarget(tgt, gt); this->AddGeneratorTarget(tgt, gt);
// Organize in the "predefined targets" folder: // Organize in the "predefined targets" folder:

View File

@ -87,7 +87,7 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
"Build all projects"); "Build all projects");
cmGeneratorTarget* gt = new cmGeneratorTarget(allBuild, gen[0]); cmGeneratorTarget* gt = new cmGeneratorTarget(allBuild, gen[0]);
gen[0]->AddGeneratorTarget(allBuild, gt); gen[0]->AddGeneratorTarget(gt);
this->AddGeneratorTarget(allBuild, gt); this->AddGeneratorTarget(allBuild, gt);
#if 0 #if 0
@ -108,19 +108,20 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
for(std::vector<cmLocalGenerator*>::iterator i = gen.begin(); for(std::vector<cmLocalGenerator*>::iterator i = gen.begin();
i != gen.end(); ++i) i != gen.end(); ++i)
{ {
cmGeneratorTargetsType targets = std::vector<cmGeneratorTarget*> targets =
(*i)->GetGeneratorTargets(); (*i)->GetGeneratorTargets();
for(cmGeneratorTargetsType::iterator t = targets.begin(); for(std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
t != targets.end(); ++t) t != targets.end(); ++t)
{ {
if (t->second->GetType() == cmState::GLOBAL_TARGET cmGeneratorTarget* tgt = *t;
|| t->first->IsImported()) if (tgt->GetType() == cmState::GLOBAL_TARGET
|| tgt->IsImported())
{ {
continue; continue;
} }
if(!this->IsExcluded(gen[0], t->second)) if(!this->IsExcluded(gen[0], tgt))
{ {
allBuild->AddUtility(t->second->GetName()); allBuild->AddUtility(tgt->GetName());
} }
} }
} }

View File

@ -459,7 +459,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
"echo", "Build all projects"); "echo", "Build all projects");
cmGeneratorTarget* allBuildGt = new cmGeneratorTarget(allbuild, root); cmGeneratorTarget* allBuildGt = new cmGeneratorTarget(allbuild, root);
root->AddGeneratorTarget(allbuild, allBuildGt); root->AddGeneratorTarget(allBuildGt);
root->GetGlobalGenerator()->AddGeneratorTarget(allbuild, allBuildGt); root->GetGlobalGenerator()->AddGeneratorTarget(allbuild, allBuildGt);
// Refer to the main build configuration file for easy editing. // Refer to the main build configuration file for easy editing.
@ -495,7 +495,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
"make", "-f", file.c_str()); "make", "-f", file.c_str());
cmGeneratorTarget* checkGt = new cmGeneratorTarget(check, root); cmGeneratorTarget* checkGt = new cmGeneratorTarget(check, root);
root->AddGeneratorTarget(check, checkGt); root->AddGeneratorTarget(checkGt);
root->GetGlobalGenerator()->AddGeneratorTarget(check, checkGt); root->GetGlobalGenerator()->AddGeneratorTarget(check, checkGt);
} }

View File

@ -132,15 +132,15 @@ void cmLocalGenerator::TraceDependencies()
this->GlobalGenerator->CreateEvaluationSourceFiles(*ci); this->GlobalGenerator->CreateEvaluationSourceFiles(*ci);
} }
// Generate the rule files for each target. // Generate the rule files for each target.
cmGeneratorTargetsType targets = this->GetGeneratorTargets(); std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
for(cmGeneratorTargetsType::iterator t = targets.begin(); for(std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
t != targets.end(); ++t) t != targets.end(); ++t)
{ {
if (t->second->GetType() == cmState::INTERFACE_LIBRARY) if ((*t)->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
t->second->TraceDependencies(); (*t)->TraceDependencies();
} }
} }
@ -448,9 +448,9 @@ void cmLocalGenerator::GenerateInstallRules()
} }
void cmLocalGenerator::AddGeneratorTarget(cmTarget* t, cmGeneratorTarget* gt) void cmLocalGenerator::AddGeneratorTarget(cmGeneratorTarget* gt)
{ {
this->GeneratorTargets[t] = gt; this->GeneratorTargets.push_back(gt);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -465,12 +465,12 @@ void cmLocalGenerator::ComputeTargetManifest()
} }
// Add our targets to the manifest for each configuration. // Add our targets to the manifest for each configuration.
cmGeneratorTargetsType targets = this->GetGeneratorTargets(); std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
for(cmGeneratorTargetsType::iterator t = targets.begin(); for(std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
t != targets.end(); ++t) t != targets.end(); ++t)
{ {
cmGeneratorTarget& target = *t->second; cmGeneratorTarget* target = *t;
if (target.GetType() == cmState::INTERFACE_LIBRARY) if (target->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
@ -478,7 +478,7 @@ void cmLocalGenerator::ComputeTargetManifest()
ci != configNames.end(); ++ci) ci != configNames.end(); ++ci)
{ {
const char* config = ci->c_str(); const char* config = ci->c_str();
target.ComputeTargetManifest(config); target->ComputeTargetManifest(config);
} }
} }
} }

View File

@ -113,12 +113,12 @@ public:
bool forResponseFile = false, bool forResponseFile = false,
const std::string& config = ""); const std::string& config = "");
const cmGeneratorTargetsType &GetGeneratorTargets() const const std::vector<cmGeneratorTarget*> &GetGeneratorTargets() const
{ {
return this->GeneratorTargets; return this->GeneratorTargets;
} }
void AddGeneratorTarget(cmTarget* t, cmGeneratorTarget* gt); void AddGeneratorTarget(cmGeneratorTarget* gt);
cmGeneratorTarget* FindGeneratorTargetToUse(const std::string& name) const; cmGeneratorTarget* FindGeneratorTargetToUse(const std::string& name) const;
@ -367,7 +367,7 @@ protected:
std::set<std::string> ObjectMaxPathViolations; std::set<std::string> ObjectMaxPathViolations;
std::set<cmGeneratorTarget const*> WarnCMP0063; std::set<cmGeneratorTarget const*> WarnCMP0063;
cmGeneratorTargetsType GeneratorTargets; std::vector<cmGeneratorTarget*> GeneratorTargets;
bool EmitUniversalBinaryFlags; bool EmitUniversalBinaryFlags;

View File

@ -26,16 +26,16 @@ cmLocalGhsMultiGenerator::~cmLocalGhsMultiGenerator() {}
void cmLocalGhsMultiGenerator::Generate() void cmLocalGhsMultiGenerator::Generate()
{ {
cmGeneratorTargetsType tgts = this->GetGeneratorTargets(); std::vector<cmGeneratorTarget*> tgts = this->GetGeneratorTargets();
for (cmGeneratorTargetsType::iterator l = tgts.begin(); l != tgts.end(); for (std::vector<cmGeneratorTarget*>::iterator l = tgts.begin();
++l) l != tgts.end(); ++l)
{ {
if (l->second->GetType() == cmState::INTERFACE_LIBRARY) if ((*l)->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
cmGhsMultiTargetGenerator tg(l->second); cmGhsMultiTargetGenerator tg(*l);
tg.Generate(); tg.Generate();
} }
} }

View File

@ -73,23 +73,23 @@ void cmLocalNinjaGenerator::Generate()
} }
} }
cmGeneratorTargetsType targets = this->GetGeneratorTargets(); std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
for(cmGeneratorTargetsType::iterator t = targets.begin(); for(std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
t != targets.end(); ++t) t != targets.end(); ++t)
{ {
if (t->second->GetType() == cmState::INTERFACE_LIBRARY) if ((*t)->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
cmNinjaTargetGenerator* tg = cmNinjaTargetGenerator::New(t->second); cmNinjaTargetGenerator* tg = cmNinjaTargetGenerator::New(*t);
if(tg) if(tg)
{ {
tg->Generate(); tg->Generate();
// Add the target to "all" if required. // Add the target to "all" if required.
if (!this->GetGlobalNinjaGenerator()->IsExcluded( if (!this->GetGlobalNinjaGenerator()->IsExcluded(
this->GetGlobalNinjaGenerator()->GetLocalGenerators()[0], this->GetGlobalNinjaGenerator()->GetLocalGenerators()[0],
t->second)) *t))
this->GetGlobalNinjaGenerator()->AddDependencyToAll(t->second->Target); this->GetGlobalNinjaGenerator()->AddDependencyToAll((*t)->Target);
delete tg; delete tg;
} }
} }

View File

@ -113,18 +113,18 @@ void cmLocalUnixMakefileGenerator3::Generate()
this->Makefile->IsOn("CMAKE_SKIP_ASSEMBLY_SOURCE_RULES"); this->Makefile->IsOn("CMAKE_SKIP_ASSEMBLY_SOURCE_RULES");
// Generate the rule files for each target. // Generate the rule files for each target.
cmGeneratorTargetsType targets = this->GetGeneratorTargets(); std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
cmGlobalUnixMakefileGenerator3* gg = cmGlobalUnixMakefileGenerator3* gg =
static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator); static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
for(cmGeneratorTargetsType::iterator t = targets.begin(); for(std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
t != targets.end(); ++t) t != targets.end(); ++t)
{ {
if (t->second->GetType() == cmState::INTERFACE_LIBRARY) if ((*t)->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
} }
cmsys::auto_ptr<cmMakefileTargetGenerator> tg( cmsys::auto_ptr<cmMakefileTargetGenerator> tg(
cmMakefileTargetGenerator::New(t->second)); cmMakefileTargetGenerator::New(*t));
if (tg.get()) if (tg.get())
{ {
tg->WriteRuleFiles(); tg->WriteRuleFiles();
@ -174,11 +174,11 @@ void cmLocalUnixMakefileGenerator3::
GetLocalObjectFiles(std::map<std::string, LocalObjectInfo> &localObjectFiles) GetLocalObjectFiles(std::map<std::string, LocalObjectInfo> &localObjectFiles)
{ {
std::set<std::string> emitted; std::set<std::string> emitted;
cmGeneratorTargetsType targets = this->GetGeneratorTargets(); std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
for(cmGeneratorTargetsType::iterator ti = targets.begin(); for(std::vector<cmGeneratorTarget*>::iterator ti = targets.begin();
ti != targets.end(); ++ti) ti != targets.end(); ++ti)
{ {
cmGeneratorTarget* gt = ti->second; cmGeneratorTarget* gt = *ti;
if (gt->GetType() == cmState::INTERFACE_LIBRARY) if (gt->GetType() == cmState::INTERFACE_LIBRARY)
{ {
continue; continue;
@ -417,22 +417,22 @@ void cmLocalUnixMakefileGenerator3
// for each target we just provide a rule to cd up to the top and do a make // for each target we just provide a rule to cd up to the top and do a make
// on the target // on the target
cmGeneratorTargetsType targets = this->GetGeneratorTargets(); std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets();
std::string localName; std::string localName;
for(cmGeneratorTargetsType::iterator t = targets.begin(); for(std::vector<cmGeneratorTarget*>::iterator t = targets.begin();
t != targets.end(); ++t) t != targets.end(); ++t)
{ {
if((t->second->GetType() == cmState::EXECUTABLE) || if(((*t)->GetType() == cmState::EXECUTABLE) ||
(t->second->GetType() == cmState::STATIC_LIBRARY) || ((*t)->GetType() == cmState::STATIC_LIBRARY) ||
(t->second->GetType() == cmState::SHARED_LIBRARY) || ((*t)->GetType() == cmState::SHARED_LIBRARY) ||
(t->second->GetType() == cmState::MODULE_LIBRARY) || ((*t)->GetType() == cmState::MODULE_LIBRARY) ||
(t->second->GetType() == cmState::OBJECT_LIBRARY) || ((*t)->GetType() == cmState::OBJECT_LIBRARY) ||
(t->second->GetType() == cmState::UTILITY)) ((*t)->GetType() == cmState::UTILITY))
{ {
emitted.insert(t->second->GetName()); emitted.insert((*t)->GetName());
// for subdirs add a rule to build this specific target by name. // for subdirs add a rule to build this specific target by name.
localName = this->GetRelativeTargetDirectory(t->second); localName = this->GetRelativeTargetDirectory(*t);
localName += "/rule"; localName += "/rule";
commands.clear(); commands.clear();
depends.clear(); depends.clear();
@ -449,23 +449,23 @@ void cmLocalUnixMakefileGenerator3
localName, depends, commands, true); localName, depends, commands, true);
// Add a target with the canonical name (no prefix, suffix or path). // Add a target with the canonical name (no prefix, suffix or path).
if(localName != t->second->GetName()) if(localName != (*t)->GetName())
{ {
commands.clear(); commands.clear();
depends.push_back(localName); depends.push_back(localName);
this->WriteMakeRule(ruleFileStream, "Convenience name for target.", this->WriteMakeRule(ruleFileStream, "Convenience name for target.",
t->second->GetName(), depends, commands, true); (*t)->GetName(), depends, commands, true);
} }
// Add a fast rule to build the target // Add a fast rule to build the target
std::string makefileName = std::string makefileName =
this->GetRelativeTargetDirectory(t->second); this->GetRelativeTargetDirectory(*t);
makefileName += "/build.make"; makefileName += "/build.make";
// make sure the makefile name is suitable for a makefile // make sure the makefile name is suitable for a makefile
std::string makeTargetName = std::string makeTargetName =
this->GetRelativeTargetDirectory(t->second); this->GetRelativeTargetDirectory(*t);
makeTargetName += "/build"; makeTargetName += "/build";
localName = t->second->GetName(); localName = (*t)->GetName();
localName += "/fast"; localName += "/fast";
depends.clear(); depends.clear();
commands.clear(); commands.clear();
@ -479,11 +479,11 @@ void cmLocalUnixMakefileGenerator3
// Add a local name for the rule to relink the target before // Add a local name for the rule to relink the target before
// installation. // installation.
if(t->second->NeedRelinkBeforeInstall(this->ConfigName)) if((*t)->NeedRelinkBeforeInstall(this->ConfigName))
{ {
makeTargetName = this->GetRelativeTargetDirectory(t->second); makeTargetName = this->GetRelativeTargetDirectory(*t);
makeTargetName += "/preinstall"; makeTargetName += "/preinstall";
localName = t->second->GetName(); localName = (*t)->GetName();
localName += "/preinstall"; localName += "/preinstall";
depends.clear(); depends.clear();
commands.clear(); commands.clear();

View File

@ -895,7 +895,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
commandLines, false, autogenComment.c_str()); commandLines, false, autogenComment.c_str());
cmGeneratorTarget* gt = new cmGeneratorTarget(autogenTarget, lg); cmGeneratorTarget* gt = new cmGeneratorTarget(autogenTarget, lg);
lg->AddGeneratorTarget(autogenTarget, gt); lg->AddGeneratorTarget(gt);
lg->GetGlobalGenerator()->AddGeneratorTarget(autogenTarget, gt); lg->GetGlobalGenerator()->AddGeneratorTarget(autogenTarget, gt);
// Set target folder // Set target folder