FindALSA.cmake 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # - Find alsa
  2. # Find the alsa libraries (asound)
  3. #
  4. # This module defines the following variables:
  5. # ALSA_FOUND - True if ALSA_INCLUDE_DIR & ALSA_LIBRARY are found
  6. # ALSA_LIBRARIES - Set when ALSA_LIBRARY is found
  7. # ALSA_INCLUDE_DIRS - Set when ALSA_INCLUDE_DIR is found
  8. #
  9. # ALSA_INCLUDE_DIR - where to find asoundlib.h, etc.
  10. # ALSA_LIBRARY - the asound library
  11. #
  12. #=============================================================================
  13. # Copyright 2009 Kitware, Inc.
  14. # Copyright 2009 Philip Lowman <[email protected]>
  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. # (To distributed this file outside of CMake, substitute the full
  24. # License text for the above reference.)
  25. find_path(ALSA_INCLUDE_DIR NAMES asoundlib.h
  26. PATH_SUFFIXES alsa
  27. DOC "The ALSA (asound) include directory"
  28. )
  29. find_library(ALSA_LIBRARY NAMES asound
  30. DOC "The ALSA (asound) library"
  31. )
  32. # handle the QUIETLY and REQUIRED arguments and set ALSA_FOUND to TRUE if
  33. # all listed variables are TRUE
  34. include(FindPackageHandleStandardArgs)
  35. FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALSA DEFAULT_MSG ALSA_LIBRARY ALSA_INCLUDE_DIR)
  36. if(ALSA_FOUND)
  37. set( ALSA_LIBRARIES ${ALSA_LIBRARY} )
  38. set( ALSA_INCLUDE_DIRS ${ALSA_INCLUDE_DIR} )
  39. endif()
  40. mark_as_advanced(ALSA_INCLUDE_DIR ALSA_LIBRARY)