summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2002-06-10 18:19:09 (GMT)
committerKen Martin <ken.martin@kitware.com>2002-06-10 18:19:09 (GMT)
commitfd26d44f5f244844d90dba801af57294283ceae9 (patch)
tree43933ceb15f2e65cd4efa58104aefe939b0474aa
parent781fac21f0e3ff4b12dbda9ef5778c730a8285ed (diff)
downloadCMake-fd26d44f5f244844d90dba801af57294283ceae9.zip
CMake-fd26d44f5f244844d90dba801af57294283ceae9.tar.gz
CMake-fd26d44f5f244844d90dba801af57294283ceae9.tar.bz2
now includes current include files directory when searching for files it includes
-rw-r--r--Source/cmMakeDepend.cxx32
-rw-r--r--Source/cmMakeDepend.h4
2 files changed, 26 insertions, 10 deletions
diff --git a/Source/cmMakeDepend.cxx b/Source/cmMakeDepend.cxx
index 78a7c1f..b56f26a 100644
--- a/Source/cmMakeDepend.cxx
+++ b/Source/cmMakeDepend.cxx
@@ -80,7 +80,7 @@ void cmMakeDepend::SetMakefile(const cmMakefile* makefile)
const cmDependInformation* cmMakeDepend::FindDependencies(const char* file)
{
- cmDependInformation* info = this->GetDependInformation(file);
+ cmDependInformation* info = this->GetDependInformation(file,NULL);
this->GenerateDependInformation(info);
return info;
}
@@ -235,15 +235,20 @@ void cmMakeDepend::DependWalk(cmDependInformation* info)
void cmMakeDepend::AddDependency(cmDependInformation* info, const char* file)
{
- cmDependInformation* dependInfo = this->GetDependInformation(file);
+ cmDependInformation* dependInfo =
+ this->GetDependInformation(file,
+ cmSystemTools::GetFilenamePath(
+ cmSystemTools::CollapseFullPath(
+ info->m_FullPath.c_str())).c_str());
this->GenerateDependInformation(dependInfo);
info->AddDependencies(dependInfo);
}
-cmDependInformation* cmMakeDepend::GetDependInformation(const char* file)
+cmDependInformation* cmMakeDepend::GetDependInformation(const char* file,
+ const char *extraPath)
{
// Get the full path for the file so that lookup is unambiguous.
- std::string fullPath = this->FullPath(file);
+ std::string fullPath = this->FullPath(file, extraPath);
// Try to find the file's instance of cmDependInformation.
DependInformationMap::const_iterator result =
@@ -279,7 +284,7 @@ void cmMakeDepend::GenerateMakefileDependencies()
if(!(*i)->GetIsAHeaderFileOnly())
{
cmDependInformation* info =
- this->GetDependInformation((*i)->GetFullPath().c_str());
+ this->GetDependInformation((*i)->GetFullPath().c_str(),NULL);
this->AddFileToSearchPath(info->m_FullPath.c_str());
info->m_cmSourceFile = *i;
this->GenerateDependInformation(info);
@@ -290,11 +295,11 @@ void cmMakeDepend::GenerateMakefileDependencies()
// find the full path to fname by searching the m_IncludeDirectories array
-std::string cmMakeDepend::FullPath(const char* fname)
+std::string cmMakeDepend::FullPath(const char* fname, const char *extraPath)
{
if(cmSystemTools::FileExists(fname))
{
- return std::string(fname);
+ return std::string(cmSystemTools::CollapseFullPath(fname));
}
for(std::vector<std::string>::iterator i = m_IncludeDirectories.begin();
@@ -305,10 +310,21 @@ std::string cmMakeDepend::FullPath(const char* fname)
path = path + fname;
if(cmSystemTools::FileExists(path.c_str()))
{
- return path;
+ return cmSystemTools::CollapseFullPath(path.c_str());
}
}
+ if (extraPath)
+ {
+ std::string path = extraPath;
+ path = path + "/";
+ path = path + fname;
+ if(cmSystemTools::FileExists(path.c_str()))
+ {
+ return cmSystemTools::CollapseFullPath(path.c_str());
+ }
+ }
+
// Couldn't find the file.
return std::string(fname);
}
diff --git a/Source/cmMakeDepend.h b/Source/cmMakeDepend.h
index fd904fa..5e59950 100644
--- a/Source/cmMakeDepend.h
+++ b/Source/cmMakeDepend.h
@@ -139,14 +139,14 @@ protected:
* Get an instance of cmDependInformation corresponding to the given file
* name.
*/
- cmDependInformation* GetDependInformation(const char* file);
+ cmDependInformation* GetDependInformation(const char* file, const char *extraPath);
/**
* Find the full path name for the given file name.
* This uses the include directories.
* TODO: Cache path conversions to reduce FileExists calls.
*/
- std::string FullPath(const char*);
+ std::string FullPath(const char *filename, const char *extraPath);
const cmMakefile* m_Makefile;
bool m_Verbose;