summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineFortranCompiler.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/CMakeDetermineFortranCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineFortranCompiler.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index 53a1c75..33dfce6 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -8,6 +8,9 @@ IF(NOT CMAKE_Fortran_COMPILER)
# prefer the environment variable CC
IF($ENV{FC} MATCHES ".+")
GET_FILENAME_COMPONENT(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT)
+ IF(CMAKE_Fortran_FLAGS_ENV_INIT)
+ SET(CMAKE_Fortran_COMPILER_ARG1 ${CMAKE_Fortran_FLAGS_ENV_INIT} CACHE STRING "First argument to Fortran compiler")
+ ENDIF(CMAKE_Fortran_FLAGS_ENV_INIT)
IF(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
ELSE(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.")