Skip to content

Commit

Permalink
fix: [server] start sequence configuration
Browse files Browse the repository at this point in the history
Start sequence configuration is compatible with non-v23 env.

Log: fix bug

Bug: https://pms.uniontech.com/bug-view-219739.html
  • Loading branch information
Johnson-zs committed Sep 19, 2023
1 parent 660c213 commit c4c290c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/apps/dde-file-manager-server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

0 comments on commit c4c290c

Please sign in to comment.