aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-01-26 22:43:29 +0100
committerRobert Tari <robert@tari.in>2022-01-27 10:28:25 +0100
commit3c432ed173f40a2bc8383f432185616714c4ea96 (patch)
tree9c0727d1d8868d09875575d42a3a816df466c4ac
parenta986a42c82e4c3f62d4bc19868ee518d973e3483 (diff)
downloadayatana-indicator-application-3c432ed173f40a2bc8383f432185616714c4ea96.tar.gz
ayatana-indicator-application-3c432ed173f40a2bc8383f432185616714c4ea96.tar.bz2
ayatana-indicator-application-3c432ed173f40a2bc8383f432185616714c4ea96.zip
data/CMakeLists.txt: Update detection of SYSTEMD_USER_DIR, use systemd's pkg-config variable if possible.
-rw-r--r--data/CMakeLists.txt31
1 files changed, 25 insertions, 6 deletions
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index 21f7cba..867db2f 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -1,19 +1,38 @@
# ayatana-indicator-application.service
-pkg_check_modules(SYSTEMD systemd)
+###########################
+# Systemd Job
+###########################
+pkg_check_modules(SYSTEMD systemd)
if (${SYSTEMD_FOUND})
- configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ayatana-indicator-application.service.in" "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-application.service" @ONLY)
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-application.service" DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/systemd/user")
+
+ # 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()
-# ayatana-indicator-application.desktop
+###########################
+# XDG Autostart
+###########################
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ayatana-indicator-application.desktop.in" "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-application.desktop" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayatana-indicator-application.desktop" DESTINATION "/etc/xdg/autostart")
+###########################
# ordering-override.keyfile
+###########################
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/ordering-override.keyfile" DESTINATION "${CMAKE_INSTALL_FULL_DATADIR}/ayatana-indicator-application")
-
-