# Find GFORTRAN.

SET(GFORTRAN_NAMES ${GFORTRAN_NAMES} libgfortran.a gfortran)
FIND_LIBRARY(GFORTRAN_LIBRARY
  NAMES ${GFORTRAN_NAMES}
  PATHS /usr/lib64/atlas /usr/lib/atlas 
        /usr/lib64 /usr/lib /usr/local/lib64 
        /usr/local/lib /usr/x86_64-linux-gnu/*
        /usr/lib/gcc/x86_64-linux-gnu/*
  )

IF (GFORTRAN_LIBRARY)
  SET(GFORTRAN_LIBRARIES ${GFORTRAN_LIBRARY})
  SET(GFORTRAN_FOUND "YES")
ELSE (GFORTRAN_LIBRARY)
  SET(GFORTRAN_FOUND "NO")
ENDIF (GFORTRAN_LIBRARY)

IF (GFORTRAN_FOUND)
   IF (NOT GFORTRAN_FIND_QUIETLY)
      MESSAGE(STATUS "Found GFORTRAN: ${GFORTRAN_LIBRARIES}")
   ENDIF (NOT GFORTRAN_FIND_QUIETLY)
ELSE (GFORTRAN_FOUND)
   IF (GFORTRAN_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could not find GFORTRAN")
   ENDIF (GFORTRAN_FIND_REQUIRED)
ENDIF (GFORTRAN_FOUND)