Commit ce546b22 authored by Colin Guthrie's avatar Colin Guthrie

build-sys: Provide a simple CMake Config setup (similar to pkgconfig)

I'd rather not have to do this, as I don't really see the point in
duplicating what is done in pkgconfig, but this is likely the
easiest way to avoid nasty hacks.
parent 034006ec
......@@ -51,6 +51,9 @@ pkgconfig_DATA += \
libpulse-mainloop-glib.pc
endif
cmakedir = $(libdir)/cmake/PulseAudio
cmake_DATA = PulseAudioConfig.cmake PulseAudioConfigVersion.cmake
homepage: all dist doxygen
test -d $$HOME/homepage/private
mkdir -p $$HOME/homepage/private/projects/pulseaudio $$HOME/homepage/private/projects/pulseaudio/doxygen
......
set(PULSEAUDIO_FOUND TRUE)
set(PULSEAUDIO_VERSION_MAJOR @PA_MAJOR@)
set(PULSEAUDIO_VERSION_MINOR @PA_MINOR@)
set(PULSEAUDIO_VERSION @PA_MAJOR@.@PA_MINOR@)
set(PULSEAUDIO_VERSION_STRING "@PA_MAJOR@.@PA_MINOR@")
find_path(PULSEAUDIO_INCLUDE_DIR pulse/pulseaudio.h HINTS "@PA_INCDIR@")
find_library(PULSEAUDIO_LIBRARY NAMES pulse libpulse HINTS "@PA_LIBDIR@")
ifelse(@HAVE_GLIB20@, 1, dnl
find_library(PULSEAUDIO_MAINLOOP_LIBRARY NAMES pulse-mainloop-glib libpulse-mainloop-glib HINTS "@PA_LIBDIR@")
)dnl
set(PACKAGE_VERSION @PA_MAJOR@.@PA_MINOR@)
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
set(PACKAGE_VERSION_EXACT TRUE)
endif( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
endif("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
......@@ -779,6 +779,7 @@ AS_IF([test "x$enable_glib2" = "xyes" && test "x$HAVE_GLIB20" = "x0"],
AC_SUBST(GLIB20_CFLAGS)
AC_SUBST(GLIB20_LIBS)
AC_SUBST(HAVE_GLIB20)
AM_CONDITIONAL([HAVE_GLIB20], [test "x$HAVE_GLIB20" = x1])
AS_IF([test "x$HAVE_GLIB20" = "x1"], AC_DEFINE([HAVE_GLIB], 1, [Have GLIB?]))
......@@ -1263,6 +1264,16 @@ AC_CONFIG_FILES([src/default.pa:src/daemon/default.pa.in],
AC_CONFIG_FILES([src/system.pa:src/daemon/system.pa.in],
[m4 src/system.pa > src/system.pa.gen && mv src/system.pa.gen src/system.pa])
# CMake related ProjectConfig files
PA_LIBDIR="$libdir"
AX_DEFINE_DIR(PA_LIBDIR, PA_LIBDIR, [PulseAudio library dir])
PA_INCDIR="$includedir"
AX_DEFINE_DIR(PA_INCDIR, PA_INCDIR, [PulseAudio include dir])
AC_CONFIG_FILES([PulseAudioConfig.cmake:PulseAudioConfig.cmake.in],
[m4 PulseAudioConfig.cmake > PulseAudioConfig.cmake.gen && mv PulseAudioConfig.cmake.gen PulseAudioConfig.cmake])
AC_CONFIG_FILES([PulseAudioConfigVersion.cmake])
AC_OUTPUT
# ==========================================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment