diff options
author | David Cole <david.cole@kitware.com> | 2010-11-16 19:46:30 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2010-11-16 19:46:30 (GMT) |
commit | c172ffef061c1bf412389fdf01275cf91aa2ff79 (patch) | |
tree | 1d28533950a2d04a5fd09de6d770aaf99e2f3420 /Source | |
parent | e19fa08ac9df21826b5427c4d4442a5eee45b9f9 (diff) | |
parent | 53e76c8f126fd2480c560cf2bb46a93eabbc91fa (diff) | |
download | CMake-c172ffef061c1bf412389fdf01275cf91aa2ff79.zip CMake-c172ffef061c1bf412389fdf01275cf91aa2ff79.tar.gz CMake-c172ffef061c1bf412389fdf01275cf91aa2ff79.tar.bz2 |
Merge topic 'cray-compiler'
53e76c8 Teach CMake about Cray C, C++, and Fortran compilers
34e1ac2 Create Fortran info variables for .mod behavior
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmDocumentVariables.cxx | 23 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 13 |
2 files changed, 36 insertions, 0 deletions
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index a877680..a69bb8f 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -1336,6 +1336,29 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "this variable is defined to 1.", false,"Variables for Languages"); + cm->DefineProperty( + "CMAKE_Fortran_MODDIR_FLAG", cmProperty::VARIABLE, + "Fortran flag for module output directory.", + "This stores the flag needed to pass the value of the " + "Fortran_MODULE_DIRECTORY target property to the compiler.", + false,"Variables for Languages"); + + cm->DefineProperty( + "CMAKE_Fortran_MODDIR_DEFAULT", cmProperty::VARIABLE, + "Fortran default module output directory.", + "Most Fortran compilers write .mod files to the current working " + "directory. " + "For those that do not, this is set to \".\" and used when the " + "Fortran_MODULE_DIRECTORY target property is not set.", + false,"Variables for Languages"); + + cm->DefineProperty( + "CMAKE_Fortran_MODOUT_FLAG", cmProperty::VARIABLE, + "Fortran flag to enable module output.", + "Most Fortran compilers write .mod files out by default. " + "For others, this stores the flag needed to enable module output.", + false,"Variables for Languages"); + // variables that are used by cmake but not to be documented cm->DefineProperty("CMAKE_MATCH_0", cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_MATCH_1", cmProperty::VARIABLE,0,0); 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()) { |