From c4c290c2ae719e9adb229640cfaf4717611a5274 Mon Sep 17 00:00:00 2001 From: Zhang Sheng Date: Tue, 19 Sep 2023 16:29:53 +0800 Subject: [PATCH] fix: [server] start sequence configuration Start sequence configuration is compatible with non-v23 env. Log: fix bug Bug: https://pms.uniontech.com/bug-view-219739.html --- src/apps/dde-file-manager-server/CMakeLists.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/apps/dde-file-manager-server/CMakeLists.txt b/src/apps/dde-file-manager-server/CMakeLists.txt index f4bb94e6db..bab1422180 100644 --- a/src/apps/dde-file-manager-server/CMakeLists.txt +++ b/src/apps/dde-file-manager-server/CMakeLists.txt @@ -37,15 +37,20 @@ target_link_libraries( ${DtkWidget_LIBRARIES} ) + if (NOT DEFINED SYSTEMD_USER_UNIT_DIR) pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemduserunitdir) endif() -macro(install_symlink filepath wantsdir) - file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/link/${wantsdir}/) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${SYSTEMD_USER_UNIT_DIR}/${filepath} ${PROJECT_BINARY_DIR}/link/${wantsdir}/${filepath}) - install(FILES ${PROJECT_BINARY_DIR}/link/${wantsdir}/${filepath} DESTINATION ${SYSTEMD_USER_UNIT_DIR}/${wantsdir}/) -endmacro(install_symlink) +if (COMPLIE_ON_V23) + macro(install_symlink filepath wantsdir) + file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/link/${wantsdir}/) + execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${SYSTEMD_USER_UNIT_DIR}/${filepath} ${PROJECT_BINARY_DIR}/link/${wantsdir}/${filepath}) + install(FILES ${PROJECT_BINARY_DIR}/link/${wantsdir}/${filepath} DESTINATION ${SYSTEMD_USER_UNIT_DIR}/${wantsdir}/) + endmacro(install_symlink) + + install_symlink(dde-filemanager-server.service dde-session-initialized.target.wants) +endif() # binary install(TARGETS ${PROJECT_NAME} DESTINATION bin) @@ -58,4 +63,3 @@ install(FILES dbusservice/org.deepin.filemanager.server.service install(FILES dbusservice/dde-filemanager-server.service DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/user) -install_symlink(dde-filemanager-server.service dde-session-initialized.target.wants)