From 3648649778e9e51f38f7309557fdf211ebb8a332 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Sun, 12 Feb 2017 15:06:05 +0100 Subject: [PATCH] Add cmake find_package support to autotools build system. Install cmake find_package related config files with autotools to let clients using cmake >= 2.6 find dbus library and headers by default. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99721 --- Makefile.am | 8 +++++++- cmake/CMakeLists.txt | 1 - cmake/DBus1ConfigVersion.cmake.in | 2 +- configure.ac | 2 ++ dbus-1.pc.in | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index db0d522..610895a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,8 +3,14 @@ SUBDIRS=dbus bus tools test doc pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = dbus-1.pc +cmakeconfigdir = $(libdir)/cmake/DBus1 +cmakeconfig_DATA = cmake/DBus1Config.cmake \ + cmake/DBus1ConfigVersion.cmake + DISTCLEANFILES = \ - dbus-1.pc + dbus-1.pc \ + DBus1Config.cmake \ + DBus1ConfigVersion.cmake EXTRA_DIST = \ autogen.sh \ diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 0ec1ea5..8129999 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -646,7 +646,6 @@ if(UNIX) set(PLATFORM_LIBS pthread ${LIBRT}) include(FindPkgConfig QUIET) if(PKG_CONFIG_FOUND) - set(prefix "\${pcfiledir}/../..") set(exec_prefix "\${prefix}") set(bindir "\${prefix}/${CMAKE_INSTALL_BINDIR}") set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}") diff --git a/cmake/DBus1ConfigVersion.cmake.in b/cmake/DBus1ConfigVersion.cmake.in index e691528..239bf59 100644 --- a/cmake/DBus1ConfigVersion.cmake.in +++ b/cmake/DBus1ConfigVersion.cmake.in @@ -1,4 +1,4 @@ -set(PACKAGE_VERSION "@DBUS_VERSION@") +set(PACKAGE_VERSION @DBUS_VERSION@) # Check whether the requested PACKAGE_FIND_VERSION is compatible if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") diff --git a/configure.ac b/configure.ac index 71a0855..c2fd495 100644 --- a/configure.ac +++ b/configure.ac @@ -1894,6 +1894,8 @@ doc/dbus-update-activation-environment.1.xml doc/dbus-uuidgen.1.xml dbus-1.pc dbus-1-uninstalled.pc +cmake/DBus1Config.cmake +cmake/DBus1ConfigVersion.cmake ]) AC_OUTPUT diff --git a/dbus-1.pc.in b/dbus-1.pc.in index f93d156..e57dd7d 100644 --- a/dbus-1.pc.in +++ b/dbus-1.pc.in @@ -1,4 +1,4 @@ -prefix=@prefix@ +prefix=${pcfiledir}/../.. exec_prefix=@exec_prefix@ bindir=@bindir@ libdir=@libdir@ -- 2.6.6