Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Allow (basic) overriding of fortran compiler by FC environment variable
authordegomme <augustin.degomme@unibas.ch>
Tue, 28 Jun 2016 14:25:17 +0000 (16:25 +0200)
committerdegomme <augustin.degomme@unibas.ch>
Tue, 28 Jun 2016 14:25:17 +0000 (16:25 +0200)
tools/cmake/Modules/FindGFortran.cmake

index 1369d64..67741a3 100644 (file)
@@ -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)