From a358072c520a81f48bd4394a9b2ce911093e091f Mon Sep 17 00:00:00 2001 From: ruanshudong Date: Fri, 27 Mar 2020 20:25:45 +0800 Subject: [PATCH] fix tars-tools.cmake release bug --- servant/makefile/tars-tools.cmake | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/servant/makefile/tars-tools.cmake b/servant/makefile/tars-tools.cmake index c1c969f..7e356f3 100644 --- a/servant/makefile/tars-tools.cmake +++ b/servant/makefile/tars-tools.cmake @@ -215,22 +215,21 @@ macro(gen_server APP TARGET) FILE(WRITE ${RUN_RELEASE_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND make_directory $ENV{HOME}/tarsproto/protocol/${APP}/${TARGET})\n") FILE(APPEND ${RUN_RELEASE_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND echo cp -rf ${CUR_TARS_GEN} $ENV{HOME}/tarsproto/protocol/${APP}/${TARGET})\n") FILE(APPEND ${RUN_RELEASE_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CUR_TARS_GEN} $ENV{HOME}/tarsproto/protocol/${APP}/${TARGET})\n") - elseif(LINUX) + elseif(UNIX) FILE(WRITE ${RUN_RELEASE_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND make_directory /home/tarsproto/${APP}/${TARGET})\n") FILE(APPEND ${RUN_RELEASE_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND echo cp -rf ${CUR_TARS_GEN} /home/tarsproto/${APP}/${TARGET})\n") FILE(APPEND ${RUN_RELEASE_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND cmake -E copy ${CUR_TARS_GEN} /home/tarsproto/${APP}/${TARGET})\n") endif() endforeach(TARS_FILE ${TARS_INPUT}) - endif () - #执行命令 - add_custom_target(${TARGET}-release + add_custom_target(${TARGET}-release WORKING_DIRECTORY ${CMAKE_BINARY_DIR} DEPENDS ${TARGET} COMMAND cmake -P ${RUN_RELEASE_COMMAND_FILE} COMMENT "call ${RUN_RELEASE_COMMAND_FILE}") - - FILE(APPEND ${TARS_RELEASE} "EXECUTE_PROCESS(COMMAND cmake -P ${RUN_RELEASE_COMMAND_FILE})\n") + + FILE(APPEND ${TARS_RELEASE} "EXECUTE_PROCESS(COMMAND cmake -P ${RUN_RELEASE_COMMAND_FILE})\n") + endif () endmacro() add_custom_target(upload