2 # Find the native FFTW2 includes and library, double precision
4 # FFTW2_INCLUDE_DIR - where to find [d]fftw.h
5 # FFTW2_LIBRARIES - List of libraries when using FFTW.
6 # FFTW2_FOUND - True if FFTW found.
9 # Already in cache, be silent
10 set (FFTW2_FIND_QUIETLY TRUE)
11 endif (FFTW2_INCLUDE_DIR)
16 foreach(fftw2_name dfftw fftw)
17 string(TOUPPER ${fftw2_name} fftw2_uname)
18 string(REPLACE "fftw" "rfftw" rfftw2_name ${fftw2_name})
20 find_path (FFTW2_INCLUDE_DIR ${fftw2_name}.h)
21 find_library (CFFTW2_LIBRARIES ${fftw2_name})
22 find_library (RFFTW2_LIBRARIES ${rfftw2_name})
23 TRY_COMPILE(FFTW2_FOUND "${CMAKE_BINARY_DIR}"
24 "${CMAKE_SOURCE_DIR}/cmake/TestFFTW2.c"
25 COMPILE_DEFINITIONS "-I${FFTW2_INCLUDE_DIR} -DDOUBLE -D${fftw2_uname}" )
26 endif(NOT FFTW2_FOUND)
27 endforeach(fftw2_name dfftw fftw)
30 set(FFTW2_LIBRARIES "${RFFTW2_LIBRARIES} ${CFFTW2_LIBRARIES}" CACHE STRING "Result of FFTW2 library check" FORCE)
32 set(FFTW2_INCLUDE_DIR 0)
33 set(FFTW2_LIBRARIES 0)
36 # handle the QUIETLY and REQUIRED arguments and set FFTW_FOUND to TRUE if
37 # all listed variables are TRUE
38 include (FindPackageHandleStandardArgs)
39 find_package_handle_standard_args (FFTW2 DEFAULT_MSG FFTW2_LIBRARIES FFTW2_INCLUDE_DIR)
41 mark_as_advanced (RFFTW2_LIBRARIES CFFTW2_LIBRARIES FFTW2_LIBRARIES FFTW2_INCLUDE_DIR)