1 # - Find PulseAudio includes and libraries
3 # PULSEAUDIO_FOUND - True if PULSEAUDIO_INCLUDE_DIR &
4 # PULSEAUDIO_LIBRARY are found
6 # PULSEAUDIO_INCLUDE_DIR - where to find pulse/pulseaudio.h, etc.
7 # PULSEAUDIO_LIBRARY - the pulse library
8 # PULSEAUDIO_VERSION_STRING - the version of PulseAudio found
11 find_path(PULSEAUDIO_INCLUDE_DIR
12 NAMES pulse/pulseaudio.h
13 DOC "The PulseAudio include directory"
16 find_library(PULSEAUDIO_LIBRARY
18 DOC "The PulseAudio library"
21 if(PULSEAUDIO_INCLUDE_DIR AND EXISTS "${PULSEAUDIO_INCLUDE_DIR}/pulse/version.h")
22 file(STRINGS "${PULSEAUDIO_INCLUDE_DIR}/pulse/version.h" pulse_version_str
23 REGEX "^#define[\t ]+pa_get_headers_version\\(\\)[\t ]+\\(\".*\"\\)")
25 string(REGEX REPLACE "^.*pa_get_headers_version\\(\\)[\t ]+\\(\"([^\"]*)\"\\).*$" "\\1"
26 PULSEAUDIO_VERSION_STRING "${pulse_version_str}")
27 unset(pulse_version_str)
30 include(FindPackageHandleStandardArgs)
31 find_package_handle_standard_args(PulseAudio
32 REQUIRED_VARS PULSEAUDIO_LIBRARY PULSEAUDIO_INCLUDE_DIR
33 VERSION_VAR PULSEAUDIO_VERSION_STRING