mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-11-19 18:01:33 +03:00
Make install dir for unit files configurable
Currently the systemd service unit files are installed
into /lib/systemd/system if that directory exists. This
might not be optimal for every user, e.g. when the build
system is not the target system or when building as an
unprivileged user using CMAKE_INSTALL_PREFIX.
Make this configurable by adding a cached cmake variable
CMAKE_INSTALL_SYSTEMD_UNITDIR. Usage:
- install unit files into /lib/systemd/system if it exists (old
behavior)
cmake
- don't install unit files
cmake -D CMAKE_INSTALL_SYSTEMD_UNITDIR=
- install into absolute path
cmake -D CMAKE_INSTALL_SYSTEMD_UNITDIR=/path
- install into path relative to ${CMAKE_INSTALL_PREFIX}
cmake -D CMAKE_INSTALL_SYSTEMD_UNITDIR=path
This commit is contained in:
@ -40,11 +40,11 @@ if(UNIX)
|
||||
)
|
||||
|
||||
install_wrapper_script("vpnclient" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnclient/vpnclient")
|
||||
if(EXISTS "/lib/systemd/system")
|
||||
if(NOT "${CMAKE_INSTALL_SYSTEMD_UNITDIR}" STREQUAL "")
|
||||
configure_file(${TOP_DIRECTORY}/systemd/softether-vpnclient.service ${CMAKE_BINARY_DIR}/systemd/softether-vpnclient.service)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/systemd/softether-vpnclient.service
|
||||
COMPONENT "vpnclient"
|
||||
DESTINATION "/lib/systemd/system"
|
||||
DESTINATION ${CMAKE_INSTALL_SYSTEMD_UNITDIR}
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user