fixed/improved cmake FFTW3 detection
[alexxy/gromacs.git] / cmake / FindFFTW3.cmake
1 # - Find FFTW3
2 # Find the native FFTW3 includes and library, double precision
3 #
4 #  FFTW3_INCLUDE_DIR    - where to find fftw3.h
5 #  FFTW3_LIBRARIES   - List of libraries when using FFTW.
6 #  FFTW3_FOUND       - True if FFTW found.
7
8 if (FFTW3_INCLUDE_DIR AND FFTW3_LIBRARIES)
9   # Already in cache, be silent
10   set (FFTW3_FIND_QUIETLY TRUE)
11 endif (FFTW3_INCLUDE_DIR AND FFTW3_LIBRARIES)
12
13 find_path (FFTW3_INCLUDE_DIR fftw3.h
14                 CACHE STRING "Path to headers for double precision FFTW3")
15
16
17 find_library (FFTW3_LIBRARIES 
18                 NAMES fftw3
19                 PATHS "${FFTW3_INCLUDE_DIR}/../lib"
20                 CACHE STRING "Double precision FFTW3 libraries")
21
22
23 # handle the QUIETLY and REQUIRED arguments and set FFTW_FOUND to TRUE if
24 # all listed variables are TRUE
25 include (FindPackageHandleStandardArgs)
26 find_package_handle_standard_args (FFTW3 DEFAULT_MSG FFTW3_LIBRARIES FFTW3_INCLUDE_DIR)
27
28 mark_as_advanced (FFTW3_LIBRARIES FFTW3_INCLUDE_DIR)
29
30