data/CMakeLists.txt: Use pkg-config to detect SYSTEMD_USER_DIR. Only detect it...
data/CMakeLists.txt: Use pkg-config to detect SYSTEMD_USER_DIR. Only detect it if the systemd.pc file is available.
Merge request reports
Activity
requested review from @peat-psuwit
22 22 ## Systemd Unit File 23 23 ## 24 24 25 # where to install 26 # Uncomment when we drop Vivid 27 # pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir) 28 set (SYSTEMD_USER_DIR "/usr/lib/systemd/user") 29 message (STATUS "${SYSTEMD_USER_DIR} is the systemd user unit file install dir") 25 pkg_check_modules(SYSTEMD systemd) 26 if (${SYSTEMD_FOUND}) 30 27 31 set (SYSTEMD_USER_NAME "${CMAKE_PROJECT_NAME}.service") 32 set (SYSTEMD_USER_FILE "${CMAKE_CURRENT_BINARY_DIR}/${SYSTEMD_USER_NAME}") 33 set (SYSTEMD_USER_FILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/${SYSTEMD_USER_NAME}.in") 28 pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir) 29 message (STATUS "${SYSTEMD_USER_DIR} is the systemd user unit file install dir") - Comment on lines +25 to +29
This technically falls under Automagic Dependency.
https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Automagic_dependencies
I'm not sure if we want to provide a flag to disable this (as it's done somewhere else), or to provide a default...
@peat-psuwit ping
By "somewhere else", I mean somewhere else in UBports group. Like this:
lomiri-indicator-network!119 (diffs)
So we have
USE_SYSTEMD
flag. If enabled, we'll requiresystemd.pc
and use that to get user unit path. If not, then user unit is not installed.And now that I properly look at the old code, it's then better to do option instead of default value.
What do you think?
added 7 commits
-
2e54faf8...04b20935 - 4 commits from branch
main
- 50434163 - data/CMakeLists.txt: Use pkg-config to detect SYSTEMD_USER_DIR. Only detect it...
- 5bff926f - d/control: Add B-D: pkgconf.
- 3b611a10 - d/control: Replace systemd by systemd-dev in B-D:.
Toggle commit list-
2e54faf8...04b20935 - 4 commits from branch
DEB build of UBportsCore/lomiri-indicator-location/MR-31: FAILURE. Details
added 6 commits
-
8c280558...04b20935 - 4 commits from branch
main
- ce88c3ec - data/CMakeLists.txt: Use pkg-config to detect SYSTEMD_USER_DIR. Only detect it...
- 5f994c14 - d/control: Add B-D: pkgconf.
-
8c280558...04b20935 - 4 commits from branch
requested review from @peat-psuwit