2012-10-17 10:14:19 +04:00
|
|
|
|
2012-01-27 05:13:08 +04:00
|
|
|
include(FindPkgConfig)
|
|
|
|
|
2012-10-17 10:14:19 +04:00
|
|
|
if(PKG_CONFIG_FOUND)
|
|
|
|
pkg_check_modules(PULSE libpulse)
|
2012-01-27 05:13:08 +04:00
|
|
|
endif()
|
|
|
|
|
2012-10-17 10:14:19 +04:00
|
|
|
find_path(PULSE_INCLUDE_DIR pulse/pulseaudio.h PATHS ${PULSE_INCLUDE_DIRS} PATH_SUFFIXES pulse )
|
|
|
|
find_library(PULSE_LIBRARY pulse PATHS ${PULSE_LIBRARY_DIRS})
|
|
|
|
|
2012-11-03 03:27:01 +04:00
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Pulse DEFAULT_MSG PULSE_INCLUDE_DIR PULSE_LIBRARY)
|
2012-01-27 05:13:08 +04:00
|
|
|
|
2014-11-22 01:21:00 +03:00
|
|
|
if(PULSE_LIBRARY)
|
2015-05-20 18:27:36 +03:00
|
|
|
set(PULSE_FOUND 1)
|
|
|
|
|
2014-12-04 22:06:25 +03:00
|
|
|
file(STRINGS "${PULSE_INCLUDE_DIR}/pulse/version.h" STR1 REGEX "PA_MAJOR")
|
|
|
|
file(STRINGS "${PULSE_INCLUDE_DIR}/pulse/version.h" STR2 REGEX "PA_MINOR")
|
|
|
|
file(STRINGS "${PULSE_INCLUDE_DIR}/pulse/version.h" STR3 REGEX "PA_MICRO")
|
|
|
|
|
|
|
|
string(REGEX MATCHALL "[0-9]+" PULSE_VERSION_MAJOR ${STR1})
|
|
|
|
string(REGEX MATCHALL "[0-9]+" PULSE_VERSION_MINOR ${STR2})
|
|
|
|
string(REGEX MATCHALL "[0-9]+" PULSE_VERSION_PATCH ${STR3})
|
|
|
|
|
2014-11-25 21:28:18 +03:00
|
|
|
if(PULSE_VERSION_PATCH EQUAL 0)
|
|
|
|
set(PULSE_VERSION "${PULSE_VERSION_MAJOR}.${PULSE_VERSION_MINOR}")
|
|
|
|
else()
|
|
|
|
set(PULSE_VERSION "${PULSE_VERSION_MAJOR}.${PULSE_VERSION_MINOR}.${PULSE_VERSION_PATCH}")
|
|
|
|
endif()
|
2014-11-22 01:21:00 +03:00
|
|
|
endif()
|
|
|
|
|
2014-11-25 21:28:18 +03:00
|
|
|
mark_as_advanced(PULSE_INCLUDE_DIR PULSE_LIBRARY PULSE_VERSION PULSE_VERSION_MAJOR PULSE_VERSION_MINOR PULSE_VERSION_PATCH)
|
2012-01-27 05:13:08 +04:00
|
|
|
|