summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2005-07-15 15:38:19 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2005-07-15 15:38:19 (GMT)
commitfe9714e2f0feebc21e485676fcb779b610e59451 (patch)
tree969ef57f7db2af78af7eed4fa9bc79903f89cedb /Source/cmGlobalUnixMakefileGenerator3.cxx
parent95e2b6070f6e5fed061071b7a00a2cdd706cdf50 (diff)
downloadCMake-fe9714e2f0feebc21e485676fcb779b610e59451.zip
CMake-fe9714e2f0feebc21e485676fcb779b610e59451.tar.gz
CMake-fe9714e2f0feebc21e485676fcb779b610e59451.tar.bz2
ENH: fix static build of vtk with cmake by having custom targets chain depend information
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx22
1 files changed, 19 insertions, 3 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 848ffa5..2627afd 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -889,7 +889,7 @@ cmGlobalUnixMakefileGenerator3
if(emitted.insert(lib->first).second)
{
// Add this dependency.
- this->AppendAnyGlobalDepend(depends, lib->first.c_str());
+ this->AppendAnyGlobalDepend(depends, lib->first.c_str(), emitted);
}
}
}
@@ -903,7 +903,7 @@ cmGlobalUnixMakefileGenerator3
if(emitted.insert(*util).second)
{
// Add this dependency.
- this->AppendAnyGlobalDepend(depends, util->c_str());
+ this->AppendAnyGlobalDepend(depends, util->c_str(), emitted);
}
}
}
@@ -912,7 +912,8 @@ cmGlobalUnixMakefileGenerator3
//----------------------------------------------------------------------------
void
cmGlobalUnixMakefileGenerator3
-::AppendAnyGlobalDepend(std::vector<std::string>& depends, const char* name)
+::AppendAnyGlobalDepend(std::vector<std::string>& depends, const char* name,
+ std::set<cmStdString>& emitted)
{
cmTarget *result;
@@ -930,6 +931,21 @@ cmGlobalUnixMakefileGenerator3
std::string tgtName = lg3->GetRelativeTargetDirectory(*result);
tgtName += "/all";
depends.push_back(tgtName);
+ if(result->GetType() == cmTarget::STATIC_LIBRARY)
+ {
+ const cmTarget::LinkLibraries& tlibs = result->GetLinkLibraries();
+ for(cmTarget::LinkLibraries::const_iterator lib = tlibs.begin();
+ lib != tlibs.end(); ++lib)
+ {
+ // Don't emit the same library twice for this target.
+ if(emitted.insert(lib->first).second)
+ {
+ // Add this dependency.
+ this->AppendAnyGlobalDepend(depends, lib->first.c_str(),
+ emitted);
+ }
+ }
+ }
return;
}
}