dde-application-manager/misc/service/CMakeLists.txt
weizhixiang 765365d364 feat: 设置为开机自启动,异常退出后自动拉起
设置为开机自启动,异常退出后自动拉起

Log:
Task: https://pms.uniontech.com/task-view-142733.html
Influence: 开机自启动,退出自动被拉起
Change-Id: I5c9f8ef80e8a4f5fed2aa9bb59de09455a165360
2022-06-06 17:31:12 +08:00

16 lines
731 B
CMake
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

set(SERVICE_FILES
dde-application-manager.service
)
macro(install_symlink filepath wantsdir)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/link/${wantsdir}/)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_INSTALL_PREFIX}/lib/systemd/user/${filepath} ${PROJECT_BINARY_DIR}/link/${wantsdir}/${filepath})
install(FILES ${PROJECT_BINARY_DIR}/link/${wantsdir}/${filepath} DESTINATION lib/systemd/user/${wantsdir}/)
endmacro(install_symlink)
# 安装service文件到用户service目录
install(FILES ${SERVICE_FILES} DESTINATION lib/systemd/user/)
# 添加软链接系统启动时被dde-session-initialized拉起
install_symlink(dde-application-manager.service dde-session-initialized.target.wants)