diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2002-12-10 20:55:43 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2002-12-10 20:55:43 (GMT) |
commit | a93038c52af110e1bf08968869c3ba868c582bd5 (patch) | |
tree | 255c087c3f2231ec7bb943697a7574ede00501de /Source/cmITKWrapTclCommand.cxx | |
parent | 0b8dcaddd28276f7755e21df848f3eff8e277910 (diff) | |
download | CMake-a93038c52af110e1bf08968869c3ba868c582bd5.zip CMake-a93038c52af110e1bf08968869c3ba868c582bd5.tar.gz CMake-a93038c52af110e1bf08968869c3ba868c582bd5.tar.bz2 |
ENH: update to new style MakeDepend
Diffstat (limited to 'Source/cmITKWrapTclCommand.cxx')
-rw-r--r-- | Source/cmITKWrapTclCommand.cxx | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/Source/cmITKWrapTclCommand.cxx b/Source/cmITKWrapTclCommand.cxx index 512f567..e762ce5 100644 --- a/Source/cmITKWrapTclCommand.cxx +++ b/Source/cmITKWrapTclCommand.cxx @@ -27,6 +27,37 @@ cmITKWrapTclCommand::~cmITKWrapTclCommand() delete m_MakeDepend; } + + +void +cmITKWrapTclCommand::AddDependencies(cmDependInformation const *info, + std::vector<std::string>& depends, + std::set<cmDependInformation const*>& visited) +{ + if(!info) + { + return; + } + // add info to the visited set + visited.insert(info); + + // add this dependency and the recurse + // now recurse with info's dependencies + for(cmDependInformation::DependencySet::const_iterator d = + info->m_DependencySet.begin(); + d != info->m_DependencySet.end(); ++d) + { + if (visited.find(*d) == visited.end()) + { + if((*d)->m_FullPath != "") + { + depends.push_back((*d)->m_FullPath); + } + this->AddDependencies(*d,depends,visited); + } + } +} + // cmITKWrapTclCommand bool cmITKWrapTclCommand::InitialPass(std::vector<std::string> const& argsIn) { @@ -154,17 +185,8 @@ bool cmITKWrapTclCommand::CreateCableRule(const char* configFile) m_MakeDepend->FindDependencies(inFile.c_str()); if (info) { - for(cmDependInformation::DependencySet::const_iterator d = - info->m_DependencySet.begin(); - d != info->m_DependencySet.end(); ++d) - { - // Make sure the full path is given. If not, the dependency was - // not found. - if((*d)->m_FullPath != "") - { - depends.push_back((*d)->m_FullPath); - } - } + std::set<cmDependInformation const*> visited; + this->AddDependencies(info, depends, visited); } std::vector<std::string> outputs; |