summaryrefslogtreecommitdiffstats
path: root/Source/cmOutputRequiredFilesCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2002-12-10 19:10:15 (GMT)
committerKen Martin <ken.martin@kitware.com>2002-12-10 19:10:15 (GMT)
commit7928df081777e591eff37136131d7025046ed98d (patch)
tree756e63614c9157cae454ff405d8de5f8c24c9f8b /Source/cmOutputRequiredFilesCommand.cxx
parent65032b816e92bfaee704cee217cacea8778dc813 (diff)
downloadCMake-7928df081777e591eff37136131d7025046ed98d.zip
CMake-7928df081777e591eff37136131d7025046ed98d.tar.gz
CMake-7928df081777e591eff37136131d7025046ed98d.tar.bz2
updated for changes in Depend Calcs
Diffstat (limited to 'Source/cmOutputRequiredFilesCommand.cxx')
-rw-r--r--Source/cmOutputRequiredFilesCommand.cxx44
1 files changed, 32 insertions, 12 deletions
diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx
index 8f95dee..a34d6db 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -172,6 +172,36 @@ bool cmOutputRequiredFilesCommand::InitialPass(std::vector<std::string> const& a
return true;
}
+void cmOutputRequiredFilesCommand::
+ListDependencies(cmDependInformation const *info,
+ FILE *fout,
+ std::set<cmDependInformation const*> *visited)
+{
+ // add info to the visited set
+ visited->insert(info);
+
+ // 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(info->m_FullPath != "")
+ {
+ std::string tmp = (*d)->m_FullPath;
+ std::string::size_type pos = tmp.rfind('.');
+ if(pos != std::string::npos && tmp.substr(pos) == ".cxx")
+ {
+ tmp = tmp.substr(0, pos);
+ fprintf(fout,"%s\n",(*d)->m_FullPath.c_str());
+ }
+ }
+ this->ListDependencies(*d,fout,visited);
+ }
+ }
+}
+
void cmOutputRequiredFilesCommand::FinalPass()
{
@@ -191,18 +221,8 @@ void cmOutputRequiredFilesCommand::FinalPass()
{
// write them out
FILE *fout = fopen(m_OutputFile.c_str(),"w");
- for(cmDependInformation::DependencySet::const_iterator d =
- info->m_DependencySet.begin();
- d != info->m_DependencySet.end(); ++d)
- {
- std::string tmp = (*d)->m_FullPath;
- std::string::size_type pos = tmp.rfind('.');
- if(pos != std::string::npos && tmp.substr(pos) == ".cxx")
- {
- tmp = tmp.substr(0, pos);
- fprintf(fout,"%s\n",(*d)->m_FullPath.c_str());
- }
- }
+ std::set<cmDependInformation const*> visited;
+ this->ListDependencies(info,fout, &visited);
fclose(fout);
}
}