diff options
author | Brad King <brad.king@kitware.com> | 2001-11-12 20:37:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2001-11-12 20:37:38 (GMT) |
commit | 5231ad0c7e1cafd7438789c85dad6613f38cc74f (patch) | |
tree | 1a4b933edd7d2b815d1fd2c4b73ec11c5c14f17c /Source/cmMakeDepend.cxx | |
parent | 668974b01cb5eb8c3cb7409d3c319302b73b7bb4 (diff) | |
download | CMake-5231ad0c7e1cafd7438789c85dad6613f38cc74f.zip CMake-5231ad0c7e1cafd7438789c85dad6613f38cc74f.tar.gz CMake-5231ad0c7e1cafd7438789c85dad6613f38cc74f.tar.bz2 |
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.cxx | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/Source/cmMakeDepend.cxx b/Source/cmMakeDepend.cxx index 5a18e07..5da8828 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 |