Release version 0.99.2-1
[fmit.git] / cmake / FindFFTW3.cmake
1 ##------------------------------------------------------------------------------
2 ## $Id: FindFFTW3.cmake,v 1.3 2011/01/04 23:31:32 norwin Exp $
3 ##------------------------------------------------------------------------------
4
5 # - Check for the presence of FFTW3
6 #
7 # The following variables are set when FFTW3 is found:
8 #  HAVE_FFTW3       = Set to true, if all components of FFTW3
9 #                          have been found.
10 #  FFTW3_INCLUDES = Include path for the header files of FFTW3
11 #  FFTW3_LIBRARIES     = Link these to use FFTW3
12
13 ## -----------------------------------------------------------------------------
14 ## Check for the header files
15
16 FIND_PATH (FFTW3_INCLUDES fftw3.h
17   PATHS /usr/local/include /usr/include /sw/include
18   )
19
20 ## -----------------------------------------------------------------------------
21 ## Check for the library
22
23 FIND_LIBRARY (FFTW3_LIBRARIES fftw3 fftw
24   PATHS /usr/local/lib /usr/lib /lib /sw/lib
25   )
26
27 ## -----------------------------------------------------------------------------
28 ## Actions taken when all components have been found
29
30 IF (FFTW3_INCLUDES AND FFTW3_LIBRARIES)
31   SET (HAVE_FFTW3 TRUE)
32 ELSE (FFTW3_INCLUDES AND FFTW3_LIBRARIES)
33   IF (NOT FFTW3_FIND_QUIETLY)
34     IF (NOT FFTW3_INCLUDES)
35       MESSAGE (STATUS "Unable to find FFTW3 header files!")
36     ENDIF (NOT FFTW3_INCLUDES)
37     IF (NOT FFTW3_LIBRARIES)
38       MESSAGE (STATUS "Unable to find FFTW3 library files!")
39     ENDIF (NOT FFTW3_LIBRARIES)
40   ENDIF (NOT FFTW3_FIND_QUIETLY)
41 ENDIF (FFTW3_INCLUDES AND FFTW3_LIBRARIES)
42
43 IF (HAVE_FFTW3)
44   IF (NOT FFTW3_FIND_QUIETLY)
45     MESSAGE (STATUS "Found components for FFTW3")
46     MESSAGE (STATUS "FFTW3_INCLUDES  = ${FFTW3_INCLUDES}")
47     MESSAGE (STATUS "FFTW3_LIBRARIES = ${FFTW3_LIBRARIES}")
48   ENDIF (NOT FFTW3_FIND_QUIETLY)
49 ELSE (HAVE_FFTW3)
50   IF (FFTW3_FIND_REQUIRED)
51     MESSAGE (FATAL_ERROR "Can not find FFTW3 library !")
52   ENDIF (FFTW3_FIND_REQUIRED)
53 ENDIF (HAVE_FFTW3)
54
55 ## ------------------------------------------------------------------------------
56 ## Mark as advanced ...