diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2016-06-10 14:58:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-06-17 18:22:29 (GMT) |
commit | 49f10f0d24420f7d96c5153ba64a16b3f43c4736 (patch) | |
tree | bd6ae93de51dc222b30bb127bb5d336dc157df90 /Source/cmCommonTargetGenerator.cxx | |
parent | 0392f72bef5f1394c2dba3740f2a701fe1a98f0d (diff) | |
download | CMake-49f10f0d24420f7d96c5153ba64a16b3f43c4736.zip CMake-49f10f0d24420f7d96c5153ba64a16b3f43c4736.tar.gz CMake-49f10f0d24420f7d96c5153ba64a16b3f43c4736.tar.bz2 |
cmGeneratorTarget: Adopt Fortran module directory generation
Move code to create/get the fortran module directory from the
cmCommonTargetGenerator to cmGeneratorTarget.
Rename the ComputeFortranModuleDirectory method to
CreateFortranModuleDirectory as this method *creates* the directory if
it is missing.
Diffstat (limited to 'Source/cmCommonTargetGenerator.cxx')
-rw-r--r-- | Source/cmCommonTargetGenerator.cxx | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 1cc04ea..eb1216e 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -27,7 +27,6 @@ cmCommonTargetGenerator::cmCommonTargetGenerator(cmGeneratorTarget* gt) gt->LocalGenerator->GetGlobalGenerator())) , ConfigName(LocalGenerator->GetConfigName()) , ModuleDefinitionFile(GeneratorTarget->GetModuleDefinitionFile(ConfigName)) - , FortranModuleDirectoryComputed(false) { } @@ -89,43 +88,6 @@ void cmCommonTargetGenerator::AddModuleDefinitionFlag(std::string& flags) this->LocalGenerator->AppendFlags(flags, flag); } -std::string cmCommonTargetGenerator::ComputeFortranModuleDirectory() const -{ - std::string mod_dir; - const char* target_mod_dir = - this->GeneratorTarget->GetProperty("Fortran_MODULE_DIRECTORY"); - const char* moddir_flag = - this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_FLAG"); - if (target_mod_dir && moddir_flag) { - // Compute the full path to the module directory. - if (cmSystemTools::FileIsFullPath(target_mod_dir)) { - // Already a full path. - mod_dir = target_mod_dir; - } else { - // Interpret relative to the current output directory. - mod_dir = this->LocalGenerator->GetCurrentBinaryDirectory(); - mod_dir += "/"; - mod_dir += target_mod_dir; - } - - // Make sure the module output directory exists. - cmSystemTools::MakeDirectory(mod_dir); - } - return mod_dir; -} - -std::string cmCommonTargetGenerator::GetFortranModuleDirectory() -{ - // Compute the module directory. - if (!this->FortranModuleDirectoryComputed) { - this->FortranModuleDirectoryComputed = true; - this->FortranModuleDirectory = this->ComputeFortranModuleDirectory(); - } - - // Return the computed directory. - return this->FortranModuleDirectory; -} - void cmCommonTargetGenerator::AddFortranFlags(std::string& flags) { // Enable module output if necessary. @@ -135,7 +97,7 @@ void cmCommonTargetGenerator::AddFortranFlags(std::string& flags) } // Add a module output directory flag if necessary. - std::string mod_dir = this->GetFortranModuleDirectory(); + std::string mod_dir = this->GeneratorTarget->GetFortranModuleDirectory(); if (!mod_dir.empty()) { mod_dir = this->Convert(mod_dir, this->LocalGenerator->GetWorkingDirectory(), |