FindFftw3.cmake 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # - Find Fftw3 library
  2. # Find the native Fftw3 includes and library
  3. # This module defines
  4. # FFTW3_INCLUDE_DIRS, where to find fftw3.h, Set when
  5. # FFTW3_INCLUDE_DIR is found.
  6. # FFTW3_LIBRARIES, libraries to link against to use Fftw3.
  7. # FFTW3_ROOT_DIR, The base directory to search for Fftw3.
  8. # This can also be an environment variable.
  9. # FFTW3_FOUND, If false, do not try to use Fftw3.
  10. #
  11. # also defined, but not for general use are
  12. # FFTW3_LIBRARY, where to find the Fftw3 library.
  13. #=============================================================================
  14. # Copyright 2011 Blender Foundation.
  15. #
  16. # Distributed under the OSI-approved BSD License (the "License");
  17. # see accompanying file Copyright.txt for details.
  18. #
  19. # This software is distributed WITHOUT ANY WARRANTY; without even the
  20. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  21. # See the License for more information.
  22. #=============================================================================
  23. # If FFTW3_ROOT_DIR was defined in the environment, use it.
  24. IF(NOT FFTW3_ROOT_DIR AND NOT $ENV{FFTW3_ROOT_DIR} STREQUAL "")
  25. SET(FFTW3_ROOT_DIR $ENV{FFTW3_ROOT_DIR})
  26. ENDIF()
  27. SET(_fftw3_SEARCH_DIRS
  28. ${FFTW3_ROOT_DIR}
  29. /usr/local
  30. /sw # Fink
  31. /opt/local # DarwinPorts
  32. )
  33. FIND_PATH(FFTW3_INCLUDE_DIR
  34. NAMES
  35. fftw3.h
  36. HINTS
  37. ${_fftw3_SEARCH_DIRS}
  38. PATH_SUFFIXES
  39. include
  40. )
  41. FIND_LIBRARY(FFTW3_LIBRARY
  42. NAMES
  43. fftw3
  44. HINTS
  45. ${_fftw3_SEARCH_DIRS}
  46. PATH_SUFFIXES
  47. lib64 lib
  48. )
  49. # handle the QUIETLY and REQUIRED arguments and set FFTW3_FOUND to TRUE if
  50. # all listed variables are TRUE
  51. INCLUDE(FindPackageHandleStandardArgs)
  52. FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fftw3 DEFAULT_MSG
  53. FFTW3_LIBRARY FFTW3_INCLUDE_DIR)
  54. IF(FFTW3_FOUND)
  55. SET(FFTW3_LIBRARIES ${FFTW3_LIBRARY})
  56. SET(FFTW3_INCLUDE_DIRS ${FFTW3_INCLUDE_DIR})
  57. ENDIF(FFTW3_FOUND)
  58. MARK_AS_ADVANCED(
  59. FFTW3_INCLUDE_DIR
  60. FFTW3_LIBRARY
  61. )