diff options
author | Brad King <brad.king@kitware.com> | 2015-07-29 15:49:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-07-29 17:18:46 (GMT) |
commit | 7371d8f3b49c020a14f6324ba5264d17c7dbbaee (patch) | |
tree | fdb4e8bb7008cb50fa52246f503229d1838a5b85 /Source/cmCommonTargetGenerator.cxx | |
parent | 613bc08ac15b74a395ef0eca7668f7192b438204 (diff) | |
download | CMake-7371d8f3b49c020a14f6324ba5264d17c7dbbaee.zip CMake-7371d8f3b49c020a14f6324ba5264d17c7dbbaee.tar.gz CMake-7371d8f3b49c020a14f6324ba5264d17c7dbbaee.tar.bz2 |
cmCommonTargetGenerator: Return string from GetFortranModuleDirectory
Diffstat (limited to 'Source/cmCommonTargetGenerator.cxx')
-rw-r--r-- | Source/cmCommonTargetGenerator.cxx | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index c75ac23..eb93ebc 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -101,7 +101,7 @@ void cmCommonTargetGenerator::AddModuleDefinitionFlag(std::string& flags) } //---------------------------------------------------------------------------- -const char* cmCommonTargetGenerator::GetFortranModuleDirectory() +std::string cmCommonTargetGenerator::GetFortranModuleDirectory() { // Compute the module directory. if(!this->FortranModuleDirectoryComputed) @@ -134,14 +134,7 @@ const char* cmCommonTargetGenerator::GetFortranModuleDirectory() } // Return the computed directory. - if(this->FortranModuleDirectory.empty()) - { - return 0; - } - else - { - return this->FortranModuleDirectory.c_str(); - } + return this->FortranModuleDirectory; } //---------------------------------------------------------------------------- @@ -155,19 +148,24 @@ void cmCommonTargetGenerator::AddFortranFlags(std::string& flags) } // Add a module output directory flag if necessary. - const char* mod_dir = this->GetFortranModuleDirectory(); - if(!mod_dir) + std::string mod_dir = this->GetFortranModuleDirectory(); + if (!mod_dir.empty()) + { + mod_dir = this->Convert(mod_dir, + cmLocalGenerator::START_OUTPUT, + cmLocalGenerator::SHELL); + } + else { - mod_dir = this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_DEFAULT"); + mod_dir = + this->Makefile->GetSafeDefinition("CMAKE_Fortran_MODDIR_DEFAULT"); } - if(mod_dir) + if (!mod_dir.empty()) { const char* moddir_flag = this->Makefile->GetRequiredDefinition("CMAKE_Fortran_MODDIR_FLAG"); std::string modflag = moddir_flag; - modflag += this->Convert(mod_dir, - cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::SHELL); + modflag += mod_dir; this->LocalGenerator->AppendFlags(flags, modflag); } |