aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-12-08 13:17:55 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-12-08 13:17:55 +0100
commit6204a16bde9eef80a00cd1598a7b7016c49d83b7 (patch)
tree0491dcbaf59211f02ffe9998afd88aab950e86d7
parent89937b6430287e9ba8172902c2f36f004d42d719 (diff)
parent2695f1d8fe6e47eaf1d3adf8f655389d0dffd14a (diff)
downloadayatana-indicator-display-6204a16bde9eef80a00cd1598a7b7016c49d83b7.tar.gz
ayatana-indicator-display-6204a16bde9eef80a00cd1598a7b7016c49d83b7.tar.bz2
ayatana-indicator-display-6204a16bde9eef80a00cd1598a7b7016c49d83b7.zip
Merge branch 'z3ntu-systemd'
Attributes GH PR #44: https://github.com/AyatanaIndicators/ayatana-indicator-display/pull/44
-rw-r--r--data/CMakeLists.txt33
1 files changed, 18 insertions, 15 deletions
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index 6f8cda1..cd052b6 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -21,21 +21,24 @@ add_schema (${SCHEMA_NAME})
## Systemd Unit File
##
-# where to install
-pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)
-message (STATUS "${SYSTEMD_USER_DIR} is the systemd user unit file install dir")
-
-set (SYSTEMD_USER_NAME "${CMAKE_PROJECT_NAME}.service")
-set (SYSTEMD_USER_FILE "${CMAKE_CURRENT_BINARY_DIR}/${SYSTEMD_USER_NAME}")
-set (SYSTEMD_USER_FILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/${SYSTEMD_USER_NAME}.in")
-
-# build it
-set (pkglibexecdir "${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}")
-configure_file ("${SYSTEMD_USER_FILE_IN}" "${SYSTEMD_USER_FILE}")
-
-# install it
-install (FILES "${SYSTEMD_USER_FILE}"
- DESTINATION "${SYSTEMD_USER_DIR}")
+pkg_check_modules(SYSTEMD systemd)
+if (${SYSTEMD_FOUND})
+ # where to install
+ pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)
+ message (STATUS "${SYSTEMD_USER_DIR} is the systemd user unit file install dir")
+
+ set (SYSTEMD_USER_NAME "${CMAKE_PROJECT_NAME}.service")
+ set (SYSTEMD_USER_FILE "${CMAKE_CURRENT_BINARY_DIR}/${SYSTEMD_USER_NAME}")
+ set (SYSTEMD_USER_FILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/${SYSTEMD_USER_NAME}.in")
+
+ # build it
+ set (pkglibexecdir "${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}")
+ configure_file ("${SYSTEMD_USER_FILE_IN}" "${SYSTEMD_USER_FILE}")
+
+ # install it
+ install (FILES "${SYSTEMD_USER_FILE}"
+ DESTINATION "${SYSTEMD_USER_DIR}")
+endif()
##
## XDG Autostart Config File