# Find QUADMATH.

SET(QUADMATH_NAMES ${QUADMATH_NAMES} libquadmath.a quadmath)
FIND_LIBRARY(QUADMATH_LIBRARY
  NAMES ${QUADMATH_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 (QUADMATH_LIBRARY)
  SET(QUADMATH_LIBRARIES ${QUADMATH_LIBRARY})
  SET(QUADMATH_FOUND "YES")
ELSE (QUADMATH_LIBRARY)
  SET(QUADMATH_FOUND "NO")
ENDIF (QUADMATH_LIBRARY)

IF (QUADMATH_FOUND)
   IF (NOT QUADMATH_FIND_QUIETLY)
      MESSAGE(STATUS "Found QUADMATH: ${QUADMATH_LIBRARIES}")
   ENDIF (NOT QUADMATH_FIND_QUIETLY)
ELSE (QUADMATH_FOUND)
   IF (QUADMATH_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could not find QuadMath")
   ENDIF (QUADMATH_FIND_REQUIRED)
ENDIF (QUADMATH_FOUND)