diff options
author | Alex Richardson <arichardson.kde@gmail.com> | 2022-03-19 14:56:12 +0000 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2022-03-29 11:40:15 +0000 |
commit | e827309976cab94c806fda20013915f1db2d4f5a (patch) | |
tree | 767f649af19b2e2858d8bc0caf42017360b4dbe2 /CMakeLists.txt | |
parent | 302f85d45dae5ea6d51db33b11564f7845a9b686 (diff) | |
download | dbus-e827309976cab94c806fda20013915f1db2d4f5a.tar.gz |
cmake: Fix DBUS_SESSION_SOCKET_DIR when cross-compiling
Inferring it from the environment is not correct, since the host system
could have a different temporary directory defined. Instead of guessing
based on the host, require the user to pass an explicit directory when
cross-compiling. This is helpful for me since I am cross-compiling for
FreeBSD from macOS and on my host TMPDIR is set to
/var/folders/<random characters>/T/ instead of the expected /tmp.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ae9700db..cc4926e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -575,8 +575,14 @@ if(MSVC_IDE) endif() #### Find socket directories +set(DBUS_SESSION_SOCKET_DIR "" CACHE STRING "Default directory for session socket") if(UNIX) - if(NOT $ENV{TMPDIR} STREQUAL "") + if (CMAKE_CROSSCOMPILING) + if (NOT DBUS_SESSION_SOCKET_DIR) + message(FATAL_ERROR "cannot autodetect session socket directory " + "when crosscompiling, pass -DDBUS_SESSION_SOCKET_DIR=...") + endif() + elseif(NOT $ENV{TMPDIR} STREQUAL "") set(DBUS_SESSION_SOCKET_DIR $ENV{TMPDIR}) elseif(NOT $ENV{TEMP} STREQUAL "") set(DBUS_SESSION_SOCKET_DIR $ENV{TEMP}) |