summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2015-10-01 19:17:49 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2015-10-02 11:24:05 +0100
commitd0f46841380bd55028fcc67bf8b6ef2bdd42f36b (patch)
tree7826b1cf035299e473976687a9ba4dd70526e8e0 /cmake
parent694d63b679b03d685126b72294adde6fba28aebf (diff)
On Windows, load local configuration relative to bus setup
This makes an installed tree with /some-prefix/ etc/ dbus-1/ session-local.conf share/ dbus-1/ session.conf relocatable to any location. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92028 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Tested-by: Ralf Habacker <ralf.habacker@freenet.de>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/CMakeLists.txt15
1 files changed, 14 insertions, 1 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index e072dfa0..4db9c67a 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -92,7 +92,20 @@ set(DBUS_MACHINE_UUID_FILE ${DBUS_INSTALL_DIR}/lib/dbus/machine-id)
set(DBUS_BINDIR ${EXPANDED_BINDIR})
set(DBUS_DAEMONDIR ${EXPANDED_BINDIR})
set(DBUS_LOCALSTATEDIR ${EXPANDED_LOCALSTATEDIR})
-set(DBUS_SYSCONFDIR ${EXPANDED_SYSCONFDIR})
+
+# On Windows this is relative to where we put the bus setup, in
+# ${datadir}/dbus-1. For simplicity, we only do this if
+# ${sysconfdir} = ${prefix}/etc and ${datadir} = ${prefix}/share.
+#
+# On Unix, or on Windows with weird install layouts, it's the absolute path.
+if(WIN32 AND ${EXPANDED_SYSCONFDIR} STREQUAL ${prefix}/etc AND ${EXPANDED_DATADIR} STREQUAL ${prefix}/share)
+set(SYSCONFDIR_FROM_PKGDATADIR ../../etc)
+set(DATADIR_FROM_PKGSYSCONFDIR ../../share)
+else()
+set(SYSCONFDIR_FROM_PKGDATADIR ${EXPANDED_SYSCONFDIR})
+set(DATADIR_FROM_PKGSYSCONFDIR ${EXPANDED_DATADIR})
+endif()
+
set(DBUS_LIBEXECDIR ${EXPANDED_LIBDIR})
set(DBUS_DATADIR ${EXPANDED_DATADIR})