summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-12-19 19:28:46 (GMT)
committerBrad King <brad.king@kitware.com>2007-12-19 19:28:46 (GMT)
commit891256546b5bdb8ad7f9d29014b972c93abd39bf (patch)
treedd19fa07cd8226b7a6d842263d486d34f469228c
parent9ccba7c391fef39697bfa1fb15d0ef887464a45b (diff)
downloadCMake-891256546b5bdb8ad7f9d29014b972c93abd39bf.zip
CMake-891256546b5bdb8ad7f9d29014b972c93abd39bf.tar.gz
CMake-891256546b5bdb8ad7f9d29014b972c93abd39bf.tar.bz2
ENH: Pass target directory to cmDependsFortran scanning instances.
-rw-r--r--Source/cmDependsFortran.cxx13
-rw-r--r--Source/cmDependsFortran.h10
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx2
3 files changed, 17 insertions, 8 deletions
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index 61f5e23..d120547 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -90,8 +90,9 @@ cmDependsFortran::cmDependsFortran():
}
//----------------------------------------------------------------------------
-cmDependsFortran::cmDependsFortran(std::vector<std::string> const& includes):
- IncludePath(&includes)
+cmDependsFortran::cmDependsFortran(std::vector<std::string> const& includes,
+ std::string const& targetDirectory):
+ IncludePath(&includes), TargetDirectory(targetDirectory)
{
}
@@ -267,8 +268,12 @@ bool cmDependsFortran::WriteDependencies(const char *src, const char *obj,
// Make sure the module timestamp rule is evaluated by the time
// the target finishes building.
- makeDepends << cmSystemTools::GetFilenamePath(obj) << "/build: "
- << obj << ".provides.build\n";
+ std::string driver = this->TargetDirectory;
+ driver += "/build";
+ driver = this->LocalGenerator->Convert(driver.c_str(),
+ cmLocalGenerator::HOME_OUTPUT,
+ cmLocalGenerator::MAKEFILE);
+ makeDepends << driver << ": " << obj << ".provides.build\n";
}
/*
diff --git a/Source/cmDependsFortran.h b/Source/cmDependsFortran.h
index e00681e..3b35315 100644
--- a/Source/cmDependsFortran.h
+++ b/Source/cmDependsFortran.h
@@ -31,9 +31,10 @@ public:
/** Scanning need to know the build directory name, the relative
path from the build directory to the target file, the source
- file from which to start scanning, and the include file search
- path. */
- cmDependsFortran(std::vector<std::string> const& includes);
+ file from which to start scanning, the include file search
+ path, and the target directory. */
+ cmDependsFortran(std::vector<std::string> const& includes,
+ std::string const& targetDirectory);
/** Virtual destructor to cleanup subclasses properly. */
virtual ~cmDependsFortran();
@@ -61,6 +62,9 @@ protected:
// The include file search path.
std::vector<std::string> const* IncludePath;
+ // The full path to the target's build directory.
+ std::string TargetDirectory;
+
private:
cmDependsFortran(cmDependsFortran const&); // Purposely not implemented.
void operator=(cmDependsFortran const&); // Purposely not implemented.
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index f6c091a..f113987 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1367,7 +1367,7 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies(const char* tgtInfo)
#ifdef CMAKE_BUILD_WITH_CMAKE
else if(lang == "Fortran")
{
- scanner = new cmDependsFortran(includes);
+ scanner = new cmDependsFortran(includes, dir);
}
else if(lang == "Java")
{