aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-06-16 15:39:31 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-06-16 15:46:18 +0200
commit85e6e455ad25f9154411bf1354f99d56eddcc045 (patch)
tree30aae3e289ef288f61843ea843b2b365733576c0 /data
parent10381c0b9bb5784b1029a890758049986b7e87ce (diff)
downloadlibayatana-common-85e6e455ad25f9154411bf1354f99d56eddcc045.tar.gz
libayatana-common-85e6e455ad25f9154411bf1354f99d56eddcc045.tar.bz2
libayatana-common-85e6e455ad25f9154411bf1354f99d56eddcc045.zip
data/CMakeLists.txt: Provide a hacky-whacky approach for finding the system unit dir for systemd less than 247.
Diffstat (limited to 'data')
-rw-r--r--data/CMakeLists.txt20
1 files changed, 19 insertions, 1 deletions
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index 2949f15..875cb94 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -11,7 +11,25 @@ pkg_check_modules(SYSTEMD systemd)
if (${SYSTEMD_FOUND})
if (${SYSTEMD_VERSION} VERSION_LESS 247)
- set(SYSTEMD_USER_UNIT_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/systemd/user")
+
+ # This bit now becomes really hacky-whacky...
+
+ # As systemd is a build-requirement, there should be the
+ # systemd unit directory available on the build host, so
+ # let's look for that...
+
+ if (EXISTS "/usr/lib/systemd/user")
+ # Let's try /usr/lib/ ...
+ set(SYSTEMD_USER_UNIT_DIR "/usr/lib/systemd/user")
+ elseif (EXISTS "/usr/lib64/systemd/user")
+ # Let's try /usr/lib64/ ...
+ set(SYSTEMD_USER_UNIT_DIR "/usr/lib64/systemd/user")
+ else()
+ # Fallback to something that fails on Debian and Ubuntu
+ # but might work on other distributions...
+ set(SYSTEMD_USER_UNIT_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/systemd/user")
+ endif()
+
else()
pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemd_user_unit_dir)
endif()