diff --git a/cmake/FindPulse.cmake b/cmake/FindPulse.cmake index 7c5ae83ed..be0cd33ff 100644 --- a/cmake/FindPulse.cmake +++ b/cmake/FindPulse.cmake @@ -10,5 +10,14 @@ find_library(PULSE_LIBRARY pulse PATHS ${PULSE_LIBRARY_DIRS}) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Pulse DEFAULT_MSG PULSE_INCLUDE_DIR PULSE_LIBRARY) -mark_as_advanced(PULSE_INCLUDE_DIR PULSE_LIBRARY) +if(PULSE_LIBRARY) + execute_process(COMMAND "pactl" "--version" OUTPUT_VARIABLE PULSE_VERSION_OUTPUT) + + STRING(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" PULSE_VERSION "${PULSE_VERSION_OUTPUT}") + if(NOT PULSE_VERSION) + message(FATAL_ERROR "PulseAudio is not installed") + endif() +endif() + +mark_as_advanced(PULSE_INCLUDE_DIR PULSE_LIBRARY PULSE_VERSION)