summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-06-01 13:25:10 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-06-01 13:25:10 (GMT)
commitcd97dc5f797b70e071c3a09d4e44a3e74d82f2cc (patch)
treec4470a54d39abed5bf6e5e5f9523649b7a8db592
parent35fcd2715e26eebb99742d5f5d7d5163b08f288d (diff)
downloadCMake-cd97dc5f797b70e071c3a09d4e44a3e74d82f2cc.zip
CMake-cd97dc5f797b70e071c3a09d4e44a3e74d82f2cc.tar.gz
CMake-cd97dc5f797b70e071c3a09d4e44a3e74d82f2cc.tar.bz2
BUG: Remove duplicate targets when in different generators
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx31
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h2
2 files changed, 19 insertions, 14 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 35bb134..a6fe9d9 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -144,6 +144,9 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile()
this->WriteAllRules(lg,makefileStream);
+ // Keep track of targets already listed.
+ std::set<cmStdString> emittedTargets;
+
// write the target convenience rules
unsigned int i;
for (i = 0; i < m_LocalGenerators.size(); ++i)
@@ -161,7 +164,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile()
}
lg3 = lg3->GetParent();
}
- this->WriteConvenienceRules(makefileStream,lg,exclude);
+ this->WriteConvenienceRules(makefileStream,lg,emittedTargets);
}
this->WriteHelpRule(makefileStream);
@@ -687,11 +690,8 @@ void
cmGlobalUnixMakefileGenerator3
::WriteConvenienceRules(std::ostream& ruleFileStream,
cmLocalUnixMakefileGenerator3 *lg,
- bool /* exclude */)
+ std::set<cmStdString> &emitted)
{
- // Keep track of targets already listed.
- std::set<cmStdString> emitted;
-
std::vector<std::string> depends;
std::vector<std::string> commands;
@@ -936,26 +936,31 @@ cmGlobalUnixMakefileGenerator3::WriteHelpRule(std::ostream& ruleFileStream)
lg->AppendEcho(commands,"... install");
lg->AppendEcho(commands,"... rebuild_cache");
+ // Keep track of targets already listed.
+ std::set<cmStdString> emittedTargets;
+
// for each local generator
unsigned int i;
for (i = 0; i < m_LocalGenerators.size(); ++i)
{
lg = static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]);
-
// for each target Generate the rule files for each target.
const cmTargets& targets = lg->GetMakefile()->GetTargets();
for(cmTargets::const_iterator t = targets.begin(); t != targets.end(); ++t)
{
if((t->second.GetType() == cmTarget::EXECUTABLE) ||
- (t->second.GetType() == cmTarget::STATIC_LIBRARY) ||
- (t->second.GetType() == cmTarget::SHARED_LIBRARY) ||
- (t->second.GetType() == cmTarget::MODULE_LIBRARY) ||
- (t->second.GetType() == cmTarget::UTILITY))
+ (t->second.GetType() == cmTarget::STATIC_LIBRARY) ||
+ (t->second.GetType() == cmTarget::SHARED_LIBRARY) ||
+ (t->second.GetType() == cmTarget::MODULE_LIBRARY) ||
+ (t->second.GetType() == cmTarget::UTILITY))
{
- path = "... ";
- path += t->second.GetName();
- lg->AppendEcho(commands,path.c_str());
+ if(emittedTargets.insert(t->second.GetName()).second)
+ {
+ path = "... ";
+ path += t->second.GetName();
+ lg->AppendEcho(commands,path.c_str());
+ }
}
}
}
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index d43f1ab..2de97df 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -95,7 +95,7 @@ protected:
void WriteConvenienceRules(std::ostream& ruleFileStream,
cmLocalUnixMakefileGenerator3 *,
- bool exclude);
+ std::set<cmStdString> &emitted);
void WriteConvenienceRules2(std::ostream& ruleFileStream,
cmLocalUnixMakefileGenerator3 *,
bool exclude);