fixed/improved cmake FFTW3 detection
[alexxy/gromacs.git] / cmake / FindFFTW3.cmake
index 636a96ec50678797f9ecdb79ad42fc2cc2bb5d11..616bbbf854fb4c03c2c32ce68ebd07827b88102a 100644 (file)
@@ -10,9 +10,15 @@ if (FFTW3_INCLUDE_DIR AND FFTW3_LIBRARIES)
   set (FFTW3_FIND_QUIETLY TRUE)
 endif (FFTW3_INCLUDE_DIR AND FFTW3_LIBRARIES)
 
-find_path (FFTW3_INCLUDE_DIR fftw3.h)
+find_path (FFTW3_INCLUDE_DIR fftw3.h
+               CACHE STRING "Path to headers for double precision FFTW3")
+
+
+find_library (FFTW3_LIBRARIES 
+               NAMES fftw3
+               PATHS "${FFTW3_INCLUDE_DIR}/../lib"
+               CACHE STRING "Double precision FFTW3 libraries")
 
-find_library (FFTW3_LIBRARIES NAMES fftw3)
 
 # handle the QUIETLY and REQUIRED arguments and set FFTW_FOUND to TRUE if
 # all listed variables are TRUE