/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. if(NOT LIBFFTW3_PRECISION)
  12. message(STATUS "Searching for LIBFFTW3, using default precision float")
  13. set(LIBFFTW3_PRECISION FLOAT)
  14. endif(NOT LIBFFTW3_PRECISION)
  15. find_path(LIBFFTW3_INCLUDE_DIR fftw3.h)
  16. if(LIBFFTW3_PRECISION STREQUAL FLOAT)
  17. set(LIBFFTW3_PRECISION_SUFFIX f)
  18. endif(LIBFFTW3_PRECISION STREQUAL FLOAT)
  19. if(LIBFFTW3_PRECISION STREQUAL DOUBLE)
  20. set(LIBFFTW3_PRECISION_SUFFIX "")
  21. endif(LIBFFTW3_PRECISION STREQUAL DOUBLE)
  22. if(LIBFFTW3_PRECISION STREQUAL LDOUBLE)
  23. set(LIBFFTW3_PRECISION_SUFFIX l)
  24. endif(LIBFFTW3_PRECISION STREQUAL LDOUBLE)
  25. find_library(LIBFFTW3_LIBRARY NAMES fftw3${LIBFFTW3_PRECISION_SUFFIX} libfftw3${LIBFFTW3_PRECISION_SUFFIX}-3 fftw3${LIBFFTW3_PRECISION_SUFFIX}-3)
  26. if(FIND_LIBFFTW3_VERBOSE)
  27. message(STATUS
  28. "LIBFFTW3_PRECISION ${LIBFFTW3_PRECISION}, searched for fftw3${LIBFFTW3_PRECISION_SUFFIX} libfftw3${LIBFFTW3_PRECISION_SUFFIX}-3 fftw3${LIBFFTW3_PRECISION_SUFFIX}-3
  29. and found ${LIBFFTW3_LIBRARY}"
  30. )
  31. endif(FIND_LIBFFTW3_VERBOSE)
  32. if(LIBFFTW3_LIBRARY AND LIBFFTW3_INCLUDE_DIR)
  33. set(LIBFFTW3_FOUND TRUE)
  34. message(STATUS "Found libfftw3 ${LIBFFTW3_LIBRARY}")
  35. else(LIBFFTW3_LIBRARY AND LIBFFTW3_PLUGIN_PATH)
  36. message(STATUS "Could not find libfftw3, get it http://www.fftw.org/")
  37. endif(LIBFFTW3_LIBRARY AND LIBFFTW3_INCLUDE_DIR)