FindPulseAudio.cmake 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # - Try to find PulseAudioSimple
  2. # Once done this will define
  3. #
  4. # PULSEAUDIO_FOUND - system has PulseAudioSimple
  5. # PULSEAUDIO_INCLUDE_DIR - the PulseAudioSimple include directory
  6. # PULSEAUDIO_LIBRARIES - the libraries needed to use PulseAudioSimple
  7. # PULSEAUDIO_DEFINITIONS - Compiler switches required for using PulseAudioSimple
  8. #
  9. IF(NO_PULSE)
  10. message(status "<disabled per request>")
  11. ELSE(NO_PULSE)
  12. IF (PULSEAUDIO_INCLUDE_DIR AND PULSEAUDIO_LIBRARIES)
  13. # in cache already
  14. SET(PULSEAUDIO_FIND_QUIETLY TRUE)
  15. ENDIF (PULSEAUDIO_INCLUDE_DIR AND PULSEAUDIO_LIBRARIES)
  16. IF (NOT WIN32)
  17. # use pkg-config to get the directories and then use these values
  18. # in the FIND_PATH() and FIND_LIBRARY() calls
  19. INCLUDE(FindPkgConfig)
  20. pkg_check_modules(PA libpulse)
  21. set(_PASIncDir ${PA_INCLUDE_DIRS})
  22. set(_PASLinkDir ${PA_LIBRARY_DIRS})
  23. set(_PASLinkFlags ${PA_LDFLAGS})
  24. set(_PASCflags ${PA_CFLAGS})
  25. SET(PULSEAUDIO_DEFINITIONS ${_PASCflags})
  26. ENDIF (NOT WIN32)
  27. FIND_PATH(PULSEAUDIO_INCLUDE_DIR pulse/pulseaudio.h
  28. PATHS
  29. ${_PASIncDir}
  30. PATH_SUFFIXES pulse
  31. )
  32. FIND_LIBRARY(PULSEAUDIO_LIBRARIES NAMES pulse libpulse
  33. PATHS
  34. ${_PASLinkDir}
  35. )
  36. IF (PULSEAUDIO_INCLUDE_DIR AND PULSEAUDIO_LIBRARIES)
  37. SET(PULSEAUDIO_FOUND TRUE)
  38. ELSE (PULSEAUDIO_INCLUDE_DIR AND PULSEAUDIO_LIBRARIES)
  39. SET(PULSEAUDIO_FOUND FALSE)
  40. ENDIF (PULSEAUDIO_INCLUDE_DIR AND PULSEAUDIO_LIBRARIES)
  41. IF (PULSEAUDIO_FOUND)
  42. IF (NOT PULSEAUDIO_FIND_QUIETLY)
  43. MESSAGE(STATUS "Found PulseAudio Simple: ${PULSEAUDIO_LIBRARIES}")
  44. ENDIF (NOT PULSEAUDIO_FIND_QUIETLY)
  45. SET(USE_PULSE_ 1)
  46. ELSE (PULSEAUDIO_FOUND)
  47. MESSAGE(STATUS "Could NOT find LibXml2")
  48. ENDIF (PULSEAUDIO_FOUND)
  49. MARK_AS_ADVANCED(PULSEAUDIO_INCLUDE_DIR PULSEAUDIO_LIBRARIES)
  50. ENDIf(NO_PULSE)