CMake: Add more/better GNUInstallDirs variables usage
- Use more of GNUInstallDirs' installation location variables:
BINDIR
- Don't assume that prepending
CMAKE_INSTALL_PREFIX
to any of the location variables makes sense. There is no guarantee that install locations are relative to the prefix (seeCMAKE_INSTALL_<location>
documentation) - forcefully prepending the prefix to them can generate nonsense.CMAKE_INSTALL_FULL_<location>
is what should be used to get a guaranteed-absolute version of the locations.
There are more install location assumption in the systemd services hidden inside debian/
, but I'm not sure what to do with them. Some of the normally-installed dbus service files have SystemdService
entries that reference them, so I would assume they're intended to be part of a regular installation? But they're kept outside of CMake's control and installed via Debian packaging code, so they require manual installation & are weirder to configure using CMake variables.
Is there any reason those services are handled in that way? Otherwise I'd like to submit a follow-up MR to move them out of debian/
, configure_file()
them with CMAKE_INSTALL_FULL_BINDIR
, and install()
them as part of a regular installation - maybe with an option()
to opt out of this if systemd stuff is not desired. Any opinions on that?