PageRenderTime 212ms CodeModel.GetById 80ms app.highlight 2ms RepoModel.GetById 129ms app.codeStats 0ms

/thirdparty/liblastfm2/cmake/modules/FindLibFFTW3.cmake

http://github.com/tomahawk-player/tomahawk
CMake | 45 lines | 27 code | 8 blank | 10 comment | 8 complexity | 4530ba008f58697bc331224219c2bdfa MD5 | raw file
 1# This file is copyrighted under the BSD-license for buildsystem files of KDE
 2# copyright 2010, Patrick von Reth <patrick.vonreth@gmail.com>
 3#
 4#
 5# - Try to find the LIBFFTW3 library
 6# Once done this will define
 7#
 8#  LIBFFTW3_FOUND            Set to TRUE if LIBFFTW3 librarys and include directory is found
 9#  LIBFFTW3_INCLUDE_DIR      The libfftw3 include directory
10#  LIBFFTW3_LIBRARY          The libfftw3 librarys
11
12if(NOT LIBFFTW3_PRECISION)
13  message(STATUS "Searching for LIBFFTW3, using default precision float")
14  set(LIBFFTW3_PRECISION FLOAT)
15endif(NOT LIBFFTW3_PRECISION)
16
17find_path(LIBFFTW3_INCLUDE_DIR fftw3.h)
18
19if(LIBFFTW3_PRECISION STREQUAL FLOAT)
20  set(LIBFFTW3_PRECISION_SUFFIX f)
21endif(LIBFFTW3_PRECISION STREQUAL FLOAT)
22
23if(LIBFFTW3_PRECISION STREQUAL DOUBLE)
24  set(LIBFFTW3_PRECISION_SUFFIX "")
25endif(LIBFFTW3_PRECISION STREQUAL DOUBLE)
26
27if(LIBFFTW3_PRECISION STREQUAL LDOUBLE)
28  set(LIBFFTW3_PRECISION_SUFFIX l)
29endif(LIBFFTW3_PRECISION STREQUAL LDOUBLE)
30
31find_library(LIBFFTW3_LIBRARY NAMES fftw3${LIBFFTW3_PRECISION_SUFFIX} libfftw3${LIBFFTW3_PRECISION_SUFFIX}-3 fftw3${LIBFFTW3_PRECISION_SUFFIX}-3)
32
33if(FIND_LIBFFTW3_VERBOSE)
34  message(STATUS 
35  "LIBFFTW3_PRECISION ${LIBFFTW3_PRECISION}, searched for fftw3${LIBFFTW3_PRECISION_SUFFIX} libfftw3${LIBFFTW3_PRECISION_SUFFIX}-3 fftw3${LIBFFTW3_PRECISION_SUFFIX}-3
36    and found ${LIBFFTW3_LIBRARY}"
37  )
38endif(FIND_LIBFFTW3_VERBOSE)
39
40if(LIBFFTW3_LIBRARY AND LIBFFTW3_INCLUDE_DIR)
41    set(LIBFFTW3_FOUND TRUE)
42    message(STATUS "Found libfftw3 ${LIBFFTW3_LIBRARY}")
43else(LIBFFTW3_LIBRARY AND LIBFFTW3_PLUGIN_PATH)
44    message(STATUS "Could not find libfftw3, get it http://www.fftw.org/")
45endif(LIBFFTW3_LIBRARY AND LIBFFTW3_INCLUDE_DIR)