cmGeneratorTarget: Refactor Fortran module directory lookup
Make `target_module_dir` and owned value so we can modify it.
This commit is contained in:
parent
6b8812c27e
commit
1777570fe5
|
@ -3896,10 +3896,13 @@ std::string cmGeneratorTarget::GetFortranModuleDirectory() const
|
||||||
std::string cmGeneratorTarget::CreateFortranModuleDirectory() const
|
std::string cmGeneratorTarget::CreateFortranModuleDirectory() const
|
||||||
{
|
{
|
||||||
std::string mod_dir;
|
std::string mod_dir;
|
||||||
const char* target_mod_dir = this->GetProperty("Fortran_MODULE_DIRECTORY");
|
std::string target_mod_dir;
|
||||||
|
if (const char* prop = this->GetProperty("Fortran_MODULE_DIRECTORY")) {
|
||||||
|
target_mod_dir = prop;
|
||||||
|
}
|
||||||
const char* moddir_flag =
|
const char* moddir_flag =
|
||||||
this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_FLAG");
|
this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_FLAG");
|
||||||
if (target_mod_dir && moddir_flag) {
|
if (!target_mod_dir.empty() && moddir_flag) {
|
||||||
// Compute the full path to the module directory.
|
// Compute the full path to the module directory.
|
||||||
if (cmSystemTools::FileIsFullPath(target_mod_dir)) {
|
if (cmSystemTools::FileIsFullPath(target_mod_dir)) {
|
||||||
// Already a full path.
|
// Already a full path.
|
||||||
|
|
Loading…
Reference in New Issue