summaryrefslogtreecommitdiff
path: root/Source/cmOutputRequiredFilesCommand.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2005-10-18 16:10:04 -0400
committerBill Hoffman <bill.hoffman@kitware.com>2005-10-18 16:10:04 -0400
commiteef7ccc9d60083e9687672dae0b6186c6dc631bc (patch)
tree7f51a9ec46b2cf520903842ea08c9b82bb1bde08 /Source/cmOutputRequiredFilesCommand.cxx
parentf72deca3a2ce7bc96ff0fd8ff6b20abe4fc9c753 (diff)
downloadcmake-eef7ccc9d60083e9687672dae0b6186c6dc631bc.tar.gz
ENH: add .txx files and put the start directory in the search path
Diffstat (limited to 'Source/cmOutputRequiredFilesCommand.cxx')
-rw-r--r--Source/cmOutputRequiredFilesCommand.cxx26
1 files changed, 23 insertions, 3 deletions
diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx
index 766124c14a..34a4c8e2b6 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -27,6 +27,7 @@ class cmLBDepend : public cmMakeDepend
void cmLBDepend::DependWalk(cmDependInformation* info)
{
+ m_Verbose = true;
std::ifstream fin(info->m_FullPath.c_str());
if(!fin)
{
@@ -146,6 +147,26 @@ void cmLBDepend::DependWalk(cmDependInformation* info)
}
}
}
+ if (!found)
+ {
+ cxxFile = root + ".txx";
+ if(cmSystemTools::FileExists(cxxFile.c_str()))
+ {
+ found = true;
+ }
+ for(std::vector<std::string>::iterator i =
+ m_IncludeDirectories.begin();
+ i != m_IncludeDirectories.end(); ++i)
+ {
+ std::string path = *i;
+ path = path + "/";
+ path = path + cxxFile;
+ if(cmSystemTools::FileExists(path.c_str()))
+ {
+ found = true;
+ }
+ }
+ }
if (found)
{
this->AddDependency(info, cxxFile.c_str());
@@ -178,7 +199,6 @@ ListDependencies(cmDependInformation const *info,
{
// 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();
@@ -190,7 +210,7 @@ ListDependencies(cmDependInformation const *info,
{
std::string tmp = (*d)->m_FullPath;
std::string::size_type pos = tmp.rfind('.');
- if(pos != std::string::npos && tmp.substr(pos) == ".cxx")
+ if(pos != std::string::npos && (tmp.substr(pos) != ".h"))
{
tmp = tmp.substr(0, pos);
fprintf(fout,"%s\n",(*d)->m_FullPath.c_str());
@@ -213,7 +233,7 @@ void cmOutputRequiredFilesCommand::FinalPass()
// compute the list of files
cmLBDepend md;
md.SetMakefile(m_Makefile);
-
+ md.AddSearchPath(m_Makefile->GetStartDirectory());
// find the depends for a file
const cmDependInformation *info = md.FindDependencies(m_File.c_str());
if (info)