ENH: Pass target directory to cmDependsFortran scanning instances.

This commit is contained in:
Brad King 2007-12-19 14:28:46 -05:00
parent 9ccba7c391
commit 891256546b
3 changed files with 17 additions and 8 deletions

View File

@ -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";
}
/*

View File

@ -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.

View File

@ -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")
{