summaryrefslogtreecommitdiffstats
path: root/Source/cmOutputRequiredFilesCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2001-07-17 19:09:16 (GMT)
committerBrad King <brad.king@kitware.com>2001-07-17 19:09:16 (GMT)
commit82c1916a6d1c5f01bece5d773b9739b5d546a594 (patch)
tree480a61427d133fcda0114f8e9609fe8d91ba952b /Source/cmOutputRequiredFilesCommand.cxx
parentc5381e85885c289d0669d5f3ddb5e3d2d3d2e5dd (diff)
downloadCMake-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.cxx23
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);