summaryrefslogtreecommitdiffstats
path: root/cmake/FindWrapDBus1.cmake
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2019-05-08 14:33:58 +0200
committerAlbert Astals Cid <albert.astals.cid@kdab.com>2019-05-10 15:09:49 +0000
commit400f94109dfb0b8fc28ee1e852b59891d3084624 (patch)
tree7e0eee5da3c6389eb4b00a5127d67086003526ed /cmake/FindWrapDBus1.cmake
parent263af45b4cf5c0f44e2920a6bd144983e421af92 (diff)
CMake: Wrap DBus1 find_package call to fix xproto not being picked up
DBus1 (1.12) configuration file breaks PKG_CONFIG environment variables and will thus prevent other libraries to be picked up by pkgconfig. Main sympthom is that xproto is not getting picked up anymore, which results in hundreds of lines of warnings about this being printed. Work around that by wrapping the call to find_package(DBus1) and restoring the environment. Change-Id: Ia69f10b014dddc32045b40972500a843e5d29b38 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/FindWrapDBus1.cmake')
-rw-r--r--cmake/FindWrapDBus1.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmake/FindWrapDBus1.cmake b/cmake/FindWrapDBus1.cmake
new file mode 100644
index 0000000000..3e0a31592c
--- /dev/null
+++ b/cmake/FindWrapDBus1.cmake
@@ -0,0 +1,10 @@
+# DBus1 is buggy and breaks PKG_CONFIG environment.
+# Work around that:-/
+
+set(__qt_dbus_pcd $ENV{PKG_CONFIG_DIR})
+set(__qt_dbus_pcp $ENV{PKG_CONFIG_PATH})
+set(__qt_dbus_pcl $ENV{PKG_CONFIG_LIBDIR})
+find_package(DBus1)
+set(ENV{PKG_CONFIG_DIR} ${__qt_dbus_pcd})
+set(ENV{PKG_CONFIG_PATH} ${__qt_dbus_pcp})
+set(ENV{PKG_CONFIG_LIBDIR} ${__qt_dbus_pcl})