From 613bc08ac15b74a395ef0eca7668f7192b438204 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 29 Jul 2015 11:44:25 -0400 Subject: [PATCH] cmDependsFortran: Use string to store module directory --- Source/cmDependsFortran.cxx | 13 +++++-------- Source/cmDependsFortran.h | 3 ++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index 13c6409d9..856dcd429 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -154,14 +154,10 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends, const char* stamp_dir = this->TargetDirectory.c_str(); // Get the directory in which module files will be created. - const char* mod_dir; cmMakefile* mf = this->LocalGenerator->GetMakefile(); - if(const char* target_mod_dir = - mf->GetDefinition("CMAKE_Fortran_TARGET_MODULE_DIR")) - { - mod_dir = target_mod_dir; - } - else + std::string mod_dir = + mf->GetSafeDefinition("CMAKE_Fortran_TARGET_MODULE_DIR"); + if (mod_dir.empty()) { mod_dir = this->LocalGenerator->GetMakefile()->GetCurrentBinaryDirectory(); @@ -356,7 +352,8 @@ bool cmDependsFortran ::WriteDependenciesReal(const char *obj, cmFortranSourceInfo const& info, - const char* mod_dir, const char* stamp_dir, + std::string const& mod_dir, + const char* stamp_dir, std::ostream& makeDepends, std::ostream& internalDepends) { diff --git a/Source/cmDependsFortran.h b/Source/cmDependsFortran.h index d6ec7d7eb..a8a401330 100644 --- a/Source/cmDependsFortran.h +++ b/Source/cmDependsFortran.h @@ -66,7 +66,8 @@ protected: // Actually write the depenencies to the streams. bool WriteDependenciesReal(const char *obj, cmFortranSourceInfo const& info, - const char* mod_dir, const char* stamp_dir, + std::string const& mod_dir, + const char* stamp_dir, std::ostream& makeDepends, std::ostream& internalDepends);