summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2005-05-25 16:22:32 (GMT)
committerKen Martin <ken.martin@kitware.com>2005-05-25 16:22:32 (GMT)
commitd7cbf3e1d6c3753b4d05cf43e0d9978ad154f5ff (patch)
treededfc603511a8c9d5dda7c11850ed8a895db244c
parent0e194cab8493026b036f492f26234878be9a12ed (diff)
downloadCMake-d7cbf3e1d6c3753b4d05cf43e0d9978ad154f5ff.zip
CMake-d7cbf3e1d6c3753b4d05cf43e0d9978ad154f5ff.tar.gz
CMake-d7cbf3e1d6c3753b4d05cf43e0d9978ad154f5ff.tar.bz2
BUG: a fix for constant recomputing of depends
-rw-r--r--Source/cmDepends.cxx9
-rw-r--r--Source/cmDepends.h4
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx4
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.h8
4 files changed, 17 insertions, 8 deletions
diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx
index 9544662..165eee0 100644
--- a/Source/cmDepends.cxx
+++ b/Source/cmDepends.cxx
@@ -48,6 +48,11 @@ void cmDepends::SetTargetFile(const char* dir, const char* targetFile,
m_DependsMarkFile += m_TargetFile;
m_DependsMakeFile += makeExt;
m_DependsMarkFile += markExt;
+
+ if (!m_CompileDirectory.size())
+ {
+ m_CompileDirectory = dir;
+ }
}
@@ -79,12 +84,12 @@ void cmDepends::Check()
{
// Dependency checks must be done in proper working directory.
std::string oldcwd = ".";
- if(m_Directory != ".")
+ if(m_CompileDirectory != ".")
{
// Get the CWD but do not call CollapseFullPath because
// we only need it to cd back, and the form does not matter
oldcwd = cmSystemTools::GetCurrentWorkingDirectory(false);
- cmSystemTools::ChangeDirectory(m_Directory.c_str());
+ cmSystemTools::ChangeDirectory(m_CompileDirectory.c_str());
}
// Check whether dependencies must be regenerated.
diff --git a/Source/cmDepends.h b/Source/cmDepends.h
index b9e3f99..d659af6 100644
--- a/Source/cmDepends.h
+++ b/Source/cmDepends.h
@@ -37,6 +37,9 @@ public:
void SetTargetFile(const char* dir, const char* targetFile,
const char *markExt, const char *makeExt);
+ /** at what level will the compile be done from */
+ void SetCompileDirectory(const char *dir) {m_CompileDirectory = dir;};
+
/** should this be verbose in its output */
void SetVerbose(bool verb) { m_Verbose = verb; }
@@ -71,6 +74,7 @@ protected:
// The directory in which the build rule for the target file is executed.
std::string m_Directory;
+ std::string m_CompileDirectory;
// The name of the target file for which dependencies are maintained.
std::string m_TargetFile;
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 4ad36cf..d507fdc 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -2697,6 +2697,7 @@ cmLocalUnixMakefileGenerator3::GetDependsChecker(const std::string& lang,
if (ret)
{
ret->SetTargetFile(dir, objFile, ".depend",".build.depend.make");
+ ret->SetCompileDirectory(m_Makefile->GetHomeOutputDirectory());
ret->SetVerbose(verbose);
}
return ret;
@@ -2958,8 +2959,7 @@ void cmLocalUnixMakefileGenerator3::CheckDependencies(cmMakefile* mf,
{
// Construct a checker for the given language.
std::auto_ptr<cmDepends>
- checker(cmLocalUnixMakefileGenerator3
- ::GetDependsChecker(*l, ".", f->c_str(), verbose));
+ checker(this->GetDependsChecker(*l, ".", f->c_str(), verbose));
if(checker.get())
{
checker->Check();
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 9f1898f..39f4048 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -215,10 +215,10 @@ protected:
std::string& depMarkFile);
// return the appropriate depends checker
- static cmDepends* GetDependsChecker(const std::string& lang,
- const char* dir,
- const char* objFile,
- bool verbose);
+ cmDepends* GetDependsChecker(const std::string& lang,
+ const char* dir,
+ const char* objFile,
+ bool verbose);
std::string GenerateCustomRuleFile(const cmCustomCommand& cc,