2012-10-17 02:14:19 -04:00
|
|
|
|
2012-01-27 02:13:08 +01:00
|
|
|
include(FindPkgConfig)
|
|
|
|
|
2012-10-17 02:14:19 -04:00
|
|
|
if(PKG_CONFIG_FOUND)
|
|
|
|
pkg_check_modules(PULSE libpulse)
|
2012-01-27 02:13:08 +01:00
|
|
|
endif()
|
|
|
|
|
2012-10-17 02: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-02 19:27:01 -04:00
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Pulse DEFAULT_MSG PULSE_INCLUDE_DIR PULSE_LIBRARY)
|
2012-01-27 02:13:08 +01:00
|
|
|
|
2014-11-21 17:21:00 -05:00
|
|
|
if(PULSE_LIBRARY)
|
2015-05-20 11:27:36 -04:00
|
|
|
set(PULSE_FOUND 1)
|
|
|
|
|
2014-12-04 14:06:25 -05: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 13:28:18 -05: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-21 17:21:00 -05:00
|
|
|
endif()
|
|
|
|
|
2014-11-25 13:28:18 -05:00
|
|
|
mark_as_advanced(PULSE_INCLUDE_DIR PULSE_LIBRARY PULSE_VERSION PULSE_VERSION_MAJOR PULSE_VERSION_MINOR PULSE_VERSION_PATCH)
|
2012-01-27 02:13:08 +01:00
|
|
|
|