diff options
author | Brad King <brad.king@kitware.com> | 2001-07-17 19:09:16 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2001-07-17 19:09:16 (GMT) |
commit | 82c1916a6d1c5f01bece5d773b9739b5d546a594 (patch) | |
tree | 480a61427d133fcda0114f8e9609fe8d91ba952b /Source/cmOutputRequiredFilesCommand.cxx | |
parent | c5381e85885c289d0669d5f3ddb5e3d2d3d2e5dd (diff) | |
download | CMake-82c1916a6d1c5f01bece5d773b9739b5d546a594.zip CMake-82c1916a6d1c5f01bece5d773b9739b5d546a594.tar.gz CMake-82c1916a6d1c5f01bece5d773b9739b5d546a594.tar.bz2 |
ENH: Hacked together a new implementation of the dependency generator code. This should support finding dependencies for individual files without doing them for the entire makefile. Use cmMakeDepend::FindDependencies() to do this.
Diffstat (limited to 'Source/cmOutputRequiredFilesCommand.cxx')
-rw-r--r-- | Source/cmOutputRequiredFilesCommand.cxx | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index a998581..d796ad7 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/Source/cmOutputRequiredFilesCommand.cxx @@ -46,15 +46,15 @@ class cmLBDepend : public cmMakeDepend /** * Compute the depend information for this class. */ - void DependWalk(cmDependInformation* info, const char* file); + virtual void DependWalk(cmDependInformation* info); }; -void cmLBDepend::DependWalk(cmDependInformation* info, const char* file) +void cmLBDepend::DependWalk(cmDependInformation* info) { - std::ifstream fin(file); + std::ifstream fin(info->m_FullPath.c_str()); if(!fin) { - cmSystemTools::Error("error can not open ", file); + cmSystemTools::Error("error can not open ", info->m_FullPath.c_str()); return; } @@ -98,7 +98,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info, const char* file) std::string message = "Skipping "; message += includeFile; message += " for file "; - message += file; + message += info->m_FullPath.c_str(); cmSystemTools::Error(message.c_str(), 0); } continue; @@ -208,28 +208,27 @@ void cmOutputRequiredFilesCommand::FinalPass() // compute the list of files cmLBDepend md; md.SetMakefile(m_Makefile); - md.GenerateDependInformation(); // always expand the first argument m_Makefile->ExpandVariablesInString(m_File); m_Makefile->ExpandVariablesInString(m_OutputFile); // find the depends for a file - const cmDependInformation *info = md.GetDependInformationForSourceFile(m_File.c_str()); + const cmDependInformation *info = md.FindDependencies(m_File.c_str()); if (info) { // write them out FILE *fout = fopen(m_OutputFile.c_str(),"w"); - for( cmDependInformation::IndexSet::const_iterator indx = - info->m_IndexSet.begin(); - indx != info->m_IndexSet.end(); ++indx) + for(cmDependInformation::DependencySet::const_iterator d = + info->m_DependencySet.begin(); + d != info->m_DependencySet.end(); ++d) { - std::string tmp = md.GetDependInformation()[*indx]->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",md.GetDependInformation()[*indx]->m_FullPath.c_str()); + fprintf(fout,"%s\n",(*d)->m_FullPath.c_str()); } } fclose(fout); |