summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 014feb9..e0d9fda 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -993,12 +993,16 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
*this->InfoFileStream << " )\n";
}
+ std::string const& working_dir =
+ this->LocalGenerator->GetCurrentBinaryDirectory();
+
/* clang-format off */
*this->InfoFileStream
<< "\n"
<< "# Fortran module output directory.\n"
<< "set(CMAKE_Fortran_TARGET_MODULE_DIR \""
- << this->GeneratorTarget->GetFortranModuleDirectory() << "\")\n";
+ << this->GeneratorTarget->GetFortranModuleDirectory(working_dir)
+ << "\")\n";
/* clang-format on */
// and now write the rule to use it