diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index 4c0f688295682878097ed28c326a3c1bbbd89c57..aaa9d3ac9b7f229c8285088a4841cf1a674b9a58 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -707,5 +707,9 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile, std::string cmDependsFortran::MaybeConvertToRelativePath( std::string const& base, std::string const& path) { - return this->LocalGenerator->ConvertToRelativePath(base, path); + if (!cmOutputConverter::ContainedInDirectory( + base, path, this->LocalGenerator->GetStateSnapshot().GetDirectory())) { + return path; + } + return cmOutputConverter::ForceToRelativePath(base, path); }