cmake, autotools: Add find package config support for cmake clients
authorRalf Habacker <ralf.habacker@freenet.de>
Fri, 3 Mar 2017 11:39:23 +0000 (11:39 +0000)
committerSimon McVittie <smcv@debian.org>
Mon, 20 Mar 2017 14:18:45 +0000 (14:18 +0000)
commitd160c1a71acc157613a5fc4e1ff315d1607f66ff
treea7c49a939ade289aae5de6ba3a8a9c2c726762a6
parent216627825dd6fd5675b4c521b8b67b7850d7ad4c
cmake, autotools: Add find package config support for cmake clients

With this support cmake and autotools generates cmake equivalent of
pkgconfig files on configure time named DBus1Config*.cmake. These
files are installed into the related directory where cmake expects
find_package related config files.

For instructions how to use this feature with clients see readme.cmake.

With previous DBus versions each cmake client using DBus as dependency
needed a related FindDBus*.cmake in its source distribution or in
the cmake binary packages. With the 'config' find package style support
provided by this patch this requirement has been removed.

The generated config file uses pkgconfig on unix or autotools to
fetch package build flags, which is the prefered way. On Windows
we do not want to require CMake users to have pkg-config installed
so it uses cmake buildin target export support for exporting all
targets into DBus1ConfigTargets*.cmake.

[smcv: make sure variable substitution works in Autotools too]

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99721
Reviewed-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Makefile.am
README.cmake
cmake/CMakeLists.txt
cmake/DBus1Config.cmake.in [new file with mode: 0644]
cmake/DBus1Config.pkgconfig.in [new file with mode: 0644]
cmake/DBus1ConfigVersion.cmake.in [new file with mode: 0644]
configure.ac