summaryrefslogtreecommitdiff
path: root/cmake/DBus1Config.pkgconfig.in
Commit message (Collapse)AuthorAgeFilesLines
* cmake: Look for dbus-arch-deps.h next to DBus1Config.cmakeSimon McVittie2022-03-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | <dbus/dbus-arch-deps.h> is architecture-dependent, and compilers have not traditionally supported an installation path for architecture-specific headers (Debian-based systems have /usr/include/${multiarch_tuple}, but that isn't portable beyond Debian). When dbus was built using Autotools, dependent projects that use CMake need to look for this header in the right place. Unfortunately, it seems that at least recent versions of CMake will ignore the HINTS we get from pkg-config if they are told to search in a non-standard prefix via ${DBus1_ROOT}. Look for dbus-arch-deps.h in a directory derived from the filename of the CMake config file, before trying the normal search algorithm. The CMake config file is in ${libdir}, and so is the architecture-specific header, so this should work reasonably reliably. According to the CMake documentation, if we search for the same thing multiple times, the first successful result will be used; and searching with NO_DEFAULT_PATH is the official way to prepend things to the search order. Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/314 Signed-off-by: Simon McVittie <smcv@collabora.com>
* CMake: Set IMPORTED_IMPLIB propertyJulien Schueller2021-11-181-0/+1
| | | | | Setting this property allows to fix linking to the imported target with MinGW. This only happens when dbus is built using autotools, when cmake is used the DBus1Config.variant.in is configured and the automatically exported target by cmake is fine.
* cmake: Avoid overwriting PKG_CONFIG_PATH env varClemens Lang2019-03-141-0/+27
| | | | | | | | | | | | | | | | | | The CMake config file installed by DBus will run in the context of other projects. Consequently, changing the value of the PKG_CONFIG_DIR, PKG_CONFIG_PATH or PKG_CONFIG_LIBDIR environment variables will affect any further calls to pkg-config made by such projects, which can cause problems. A common case of this happening are pkg-config files installed in usr/share/pkgconfig for .pc files that are architecture-independent, as for example systemd does. Avoid clobbering the environment variables by saving and restoring their values. Note that for some of the variables, setting them to an empty string is different from not setting them at all. Signed-off-by: Clemens Lang <clemens.lang@bmw-carit.de>
* cmake, autotools: Add find package config support for cmake clientsRalf Habacker2017-03-201-0/+48
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>