summaryrefslogtreecommitdiff
path: root/Source/cmMakeDepend.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2001-11-12 15:37:38 -0500
committerBrad King <brad.king@kitware.com>2001-11-12 15:37:38 -0500
commit5231ad0c7e1cafd7438789c85dad6613f38cc74f (patch)
tree1a4b933edd7d2b815d1fd2c4b73ec11c5c14f17c /Source/cmMakeDepend.cxx
parent668974b01cb5eb8c3cb7409d3c319302b73b7bb4 (diff)
downloadcmake-5231ad0c7e1cafd7438789c85dad6613f38cc74f.tar.gz
ENH: cmMakeDepend::GenerateDependInformation will now use hints regardless of whether the actual file exists. This can be used to add dependencies to .h files which are generated but included in hand-written .cxx files. If the .cxx does exist, though, it will be used first, and the hints will be used afterward.
Diffstat (limited to 'Source/cmMakeDepend.cxx')
-rw-r--r--Source/cmMakeDepend.cxx33
1 files changed, 19 insertions, 14 deletions
diff --git a/Source/cmMakeDepend.cxx b/Source/cmMakeDepend.cxx
index 5a18e072fe..5da88286c3 100644
--- a/Source/cmMakeDepend.cxx
+++ b/Source/cmMakeDepend.cxx
@@ -129,16 +129,18 @@ void cmMakeDepend::GenerateDependInformation(cmDependInformation* info)
return;
}
+ bool found = false;
+
// If the file exists, use it to find dependency information.
if(cmSystemTools::FileExists(path))
{
// Use the real file to find its dependencies.
this->DependWalk(info);
- return;
+ found = true;
}
- // The file doesn't exist. See if the cmSourceFile for it has any files
- // specified as dependency hints.
+ // See if the cmSourceFile for it has any files specified as
+ // dependency hints.
if(info->m_cmSourceFile != 0)
{
// Get the cmSourceFile corresponding to this.
@@ -147,7 +149,7 @@ void cmMakeDepend::GenerateDependInformation(cmDependInformation* info)
// file.
if(!cFile.GetDepends().empty())
{
- // Initial dependencies have been given. Use them to begin the
+ // Dependency hints have been given. Use them to begin the
// recursion.
for(std::vector<std::string>::const_iterator file =
cFile.GetDepends().begin(); file != cFile.GetDepends().end();
@@ -157,21 +159,24 @@ void cmMakeDepend::GenerateDependInformation(cmDependInformation* info)
}
// Found dependency information. We are done.
- return;
+ found = true;
}
}
- // Couldn't find any dependency information.
- if(m_ComplainFileRegularExpression.find(info->m_IncludeName.c_str()))
+ if(!found)
{
- cmSystemTools::Error("error cannot find dependencies for ", path);
+ // Couldn't find any dependency information.
+ if(m_ComplainFileRegularExpression.find(info->m_IncludeName.c_str()))
+ {
+ cmSystemTools::Error("error cannot find dependencies for ", path);
+ }
+ else
+ {
+ // Destroy the name of the file so that it won't be output as a
+ // dependency.
+ info->m_FullPath = "";
+ }
}
- else
- {
- // Destroy the name of the file so that it won't be output as a
- // dependency.
- info->m_FullPath = "";
- }
}
// This function actually reads the file specified and scans it for