FindFFTW

Find the FFTW library.

find_package(FFTW [REQUIRED] [QUIET]
             [COMPONENTS [single] [double] [long_double] [quad]])

By default, search for the double precision library fftw3

Search procedure

  1. FFTW_LIBRARIES and FFTW_INCLUDE_DIRS set by user –> Nothing is searched and these variables are used instead

  2. Find MKL implementation via FFTW_ENABLE_MKL –> If FFTW_ENABLE_MKL is explicitely set to ON, only MKL is considered

    If FFTW_ENABLE_MKL is explictely set to OFF, MKL will not be considered If FFTW_ENABLE_MKL is undefined, MKL is preferred

    –> MKLROOT environment variable helps to detect MKL (See FindMKL.cmake)

  3. Find official FFTW impelementation –> FFTW_ROOT variable / environment variable helps to detect FFTW

Components

If a different version or multiple versions of the library are required, these need to be specified as COMPONENTS. Note that double must be given explicitly if any COMPONENTS are specified.

The libraries corresponding to each of the COMPONENTS are:

single:FFTW::fftw3f
double:FFTW::fftw3
long_double:FFTW::fftw3l
quad:FFTW::fftw3q

Output variables

The following CMake variables are set on completion:

FFTW_FOUND:true if FFTW is found on the system
FFTW_LIBRARIES:full paths to requested FFTW libraries
FFTW_INCLUDE_DIRS:
 FFTW include directory

Input variables

The following CMake variables are checked by the function:

FFTW_USE_STATIC_LIBS:
 if true, only static libraries are found
FFTW_ROOT:if set, this path is exclusively searched
FFTW_DIR:equivalent to FFTW_ROOT (deprecated)
FFTW_PATH:equivalent to FFTW_ROOT (deprecated)
FFTW_LIBRARIES:User overriden FFTW libraries
FFTW_INCLUDE_DIRS:
 User overriden FFTW includes directories
FFTW_ENABLE_MKL:
 User requests use of MKL implementation