diff options
author | Willem Deconinck <willem.deconinck@ecmwf.int> | 2019-07-02 09:10:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-07-08 15:28:27 (GMT) |
commit | 33de4d27eb5686bc5b3f9eb96cadf3e4a30084dc (patch) | |
tree | e8a86db570c6ff8aa7b11d448579c3cbffd1d5c5 /Source | |
parent | 753373579e3dd8cf19f0fc18f4d9bec43a2d82e8 (diff) | |
download | CMake-33de4d27eb5686bc5b3f9eb96cadf3e4a30084dc.zip CMake-33de4d27eb5686bc5b3f9eb96cadf3e4a30084dc.tar.gz CMake-33de4d27eb5686bc5b3f9eb96cadf3e4a30084dc.tar.bz2 |
Fortran: Support compilers using no module prefix on submodule files
Define `CMAKE_Fortran_SUBMODULE_SEP` with an empty string to mean that
the compiler uses no module prefix on its submodule files.
Also add a default fallback to use the `.mod` extension when
`CMAKE_Fortran_SUBMODULE_EXT` is not set. This is a better guess than
no extension at all.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFortranParserImpl.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx index 18e3c10..e8b1da8 100644 --- a/Source/cmFortranParserImpl.cxx +++ b/Source/cmFortranParserImpl.cxx @@ -79,7 +79,13 @@ std::string cmFortranParser_s::ModName(std::string const& mod_name) const std::string cmFortranParser_s::SModName(std::string const& mod_name, std::string const& sub_name) const { - return mod_name + this->Compiler.SModSep + sub_name + this->Compiler.SModExt; + std::string const& SModExt = + this->Compiler.SModExt.empty() ? ".mod" : this->Compiler.SModExt; + // An empty separator means that the compiler does not use a prefix. + if (this->Compiler.SModSep.empty()) { + return sub_name + SModExt; + } + return mod_name + this->Compiler.SModSep + sub_name + SModExt; } bool cmFortranParser_FilePush(cmFortranParser* parser, const char* fname) |