From 7c7787d25177df5859ebd2ce1df165c44680c6ba Mon Sep 17 00:00:00 2001 From: degomme Date: Tue, 28 Jun 2016 16:25:17 +0200 Subject: [PATCH 1/1] Allow (basic) overriding of fortran compiler by FC environment variable --- tools/cmake/Modules/FindGFortran.cmake | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/tools/cmake/Modules/FindGFortran.cmake b/tools/cmake/Modules/FindGFortran.cmake index 1369d64bd1..67741a301a 100644 --- a/tools/cmake/Modules/FindGFortran.cmake +++ b/tools/cmake/Modules/FindGFortran.cmake @@ -1,13 +1,17 @@ -find_program(GFORTRAN_EXE - NAME gfortran - PATH_SUFFIXES bin/ - PATHS - /opt - /opt/local - /opt/csw - /sw - /usr +if(DEFINED ENV{FC}) + set (GFORTRAN_EXE $ENV{FC}) +else() + find_program(GFORTRAN_EXE + NAME gfortran + PATH_SUFFIXES bin/ + PATHS + /opt + /opt/local + /opt/csw + /sw + /usr ) +endif() mark_as_advanced(GFORTRAN_EXE) -- 2.30.2