diff options
author | Brad King <brad.king@kitware.com> | 2021-02-22 14:37:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-02-22 14:38:12 (GMT) |
commit | ec030877a2df35bea000b5037724c763fe690350 (patch) | |
tree | 20d4674c6a6fad39ecd2ff578c27466abfbe62e0 /Modules/Compiler | |
parent | 48410610a6636a73d4313479b7799c542b0d4553 (diff) | |
download | CMake-ec030877a2df35bea000b5037724c763fe690350.zip CMake-ec030877a2df35bea000b5037724c763fe690350.tar.gz CMake-ec030877a2df35bea000b5037724c763fe690350.tar.bz2 |
NAG: Fix using Fortran modules from their output directory
The NAG Fortran compiler's `-mdir` flag sets the module output
directory but does not add the directory to the search path for using
modules. This is inconsistent with other compilers like the GNU Fortran
compiler's `-J` flag that does both. In order to make these consistent,
add the module output directory with a `-I` flag on the NAG Fortran
compiler so that it will be searched when using modules too.
We already do this for the XL Fortran compiler since commit 210b0b99a9
(XL: Fix using Fortran modules from their output directory, 2020-02-28,
v3.18.0-rc1~640^2~1).
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/NAG-Fortran.cmake | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/Compiler/NAG-Fortran.cmake b/Modules/Compiler/NAG-Fortran.cmake index ffce97e..a65fd2c 100644 --- a/Modules/Compiler/NAG-Fortran.cmake +++ b/Modules/Compiler/NAG-Fortran.cmake @@ -31,6 +31,7 @@ endif() set(CMAKE_Fortran_SUBMODULE_SEP ".") set(CMAKE_Fortran_SUBMODULE_EXT ".sub") set(CMAKE_Fortran_MODDIR_FLAG "-mdir ") +set(CMAKE_Fortran_MODDIR_INCLUDE_FLAG "-I") # -mdir does not affect search path set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-PIC") set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed") set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free") |