diff options
author | Brad King <brad.king@kitware.com> | 2010-11-12 14:03:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-11-12 14:03:49 (GMT) |
commit | 34e1ac2489778a854c3ffaa9c141a9a70416a47e (patch) | |
tree | c29398abef7b2d7bb6ac25396838b50f31a10495 /Source/cmMakefileTargetGenerator.cxx | |
parent | 3c245ab2baa159ede1957c3d6ea0d8597f8b67e7 (diff) | |
download | CMake-34e1ac2489778a854c3ffaa9c141a9a70416a47e.zip CMake-34e1ac2489778a854c3ffaa9c141a9a70416a47e.tar.gz CMake-34e1ac2489778a854c3ffaa9c141a9a70416a47e.tar.bz2 |
Create Fortran info variables for .mod behavior
Define CMAKE_Fortran_MODDIR_DEFAULT and CMAKE_Fortran_MODOUT_FLAG
variables to help some Fortran compilers generate .mod files in the
current working directory.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 9153f3a..6b290ab 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1723,6 +1723,8 @@ const char* cmMakefileTargetGenerator::GetFortranModuleDirectory() this->Target->GetProperty("Fortran_MODULE_DIRECTORY"); const char* moddir_flag = this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_FLAG"); + const char* moddir_default = + this->Makefile->GetDefinition("CMAKE_Fortran_MODDIR_DEFAULT"); if(target_mod_dir && moddir_flag) { // Compute the full path to the module directory. @@ -1743,6 +1745,10 @@ const char* cmMakefileTargetGenerator::GetFortranModuleDirectory() // Make sure the module output directory exists. cmSystemTools::MakeDirectory(this->FortranModuleDirectory.c_str()); } + else if(moddir_default && moddir_flag) + { + this->FortranModuleDirectory = moddir_default; + } this->FortranModuleDirectoryComputed = true; } @@ -1760,6 +1766,13 @@ const char* cmMakefileTargetGenerator::GetFortranModuleDirectory() //---------------------------------------------------------------------------- void cmMakefileTargetGenerator::AddFortranFlags(std::string& flags) { + // Enable module output if necessary. + if(const char* modout_flag = + this->Makefile->GetDefinition("CMAKE_Fortran_MODOUT_FLAG")) + { + this->LocalGenerator->AppendFlags(flags, modout_flag); + } + // Add a module output directory flag if necessary. if(const char* mod_dir = this->GetFortranModuleDirectory()) { |