From: Ralf Habacker Date: Mon, 28 Apr 2025 14:32:02 +0000 (+0000) Subject: cmake: Make DBUS_SESSION_SOCKET_DIR in CMakeCache.txt consistent with config.h X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91d9e604d4e9177dde74f48c26a40c40b5c29c65;p=thirdparty%2Fdbus.git cmake: Make DBUS_SESSION_SOCKET_DIR in CMakeCache.txt consistent with config.h It's unexpected to have DBUS_SESSION_SOCKET_DIR take different values in CMakeCache.txt, which lists the variables that are available to be set by the caller, and in config.h, which makes their final values available to the C code. If DBUS_SESSION_SOCKET_DIR is empty and we are running on Unix, set it to its dynamically-chosen fallback before storing it in the cache. [smcv: Add commit message] Co-authored-by: Simon McVittie --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 82c1493a2..acda97525 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -562,10 +562,10 @@ if(MSVC_IDE) file(REMOVE ${PROJECT_BINARY_DIR}/data/dbus-1/services) endif() -set(DBUS_SESSION_SOCKET_DIR "" CACHE STRING "Default directory for session socket on Unix") if(UNIX AND NOT DBUS_SESSION_SOCKET_DIR) set(DBUS_SESSION_SOCKET_DIR /tmp) endif() +set(DBUS_SESSION_SOCKET_DIR "${DBUS_SESSION_SOCKET_DIR}" CACHE STRING "Default directory for session socket on Unix") # Not used on Windows, where there is no system bus set(DBUS_SYSTEM_PID_FILE ${DBUS_RUNSTATEDIR}/dbus/pid)