2 # Find the native FFTW3 includes and library, double precision
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.
8 # The FFTW3 root installation directory can be provided in the FFTW3_ROOT_DIR
10 if (FFTW3_INCLUDE_DIR AND FFTW3_LIBRARIES)
11 # Already in cache, be silent
12 set (FFTW3_FIND_QUIETLY TRUE)
13 endif (FFTW3_INCLUDE_DIR AND FFTW3_LIBRARIES)
15 file(TO_CMAKE_PATH "$ENV{FFTW3_ROOT_DIR}" _env_FFTW3_ROOT_DIR)
17 find_path (FFTW3_INCLUDE_DIR fftw3.h
18 PATHS "${_env_FFTW3_ROOT_DIR}/include"
19 CACHE STRING "Path to double precision FFTW3 headers")
21 find_library (FFTW3_LIBRARIES
23 PATHS "${_env_FFTW3_ROOT_DIR}/lib"
24 "${FFTW3_INCLUDE_DIR}/../lib"
25 CACHE STRING "Double precision FFTW3 libraries")
27 # handle the QUIETLY and REQUIRED arguments and set FFTW_FOUND to TRUE if
28 # all listed variables are TRUE
29 include (FindPackageHandleStandardArgs)
30 set(__MSG "Could not find FFTW3. Provide the fftw3 install directory in the FFTW3_ROOT_DIR environment variable.")
31 find_package_handle_standard_args (FFTW3 ${__MSG} FFTW3_LIBRARIES FFTW3_INCLUDE_DIR)
33 mark_as_advanced (FFTW3_LIBRARIES FFTW3_INCLUDE_DIR)