mirror of
https://gitee.com/TarsCloud/TarsCpp.git
synced 2024-12-22 22:16:38 +08:00
Merge pull request #75 from sxdpd/feature/sxdpd/fix_tars_tools_cmake_script_make_tar_bug_with_msvc
Update tars-tools.cmake
This commit is contained in:
commit
4786478801
@ -164,13 +164,19 @@ macro(gen_server APP TARGET)
|
||||
FILE(WRITE ${RUN_TAR_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E echo mkdir -p ${CMAKE_BINARY_DIR}/tmp/${TARGET})\n")
|
||||
FILE(APPEND ${RUN_TAR_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E echo rm -rf ${CMAKE_BINARY_DIR}/tmp/${TARGET})\n")
|
||||
FILE(APPEND ${RUN_TAR_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/tmp/${TARGET})\n")
|
||||
FILE(APPEND ${RUN_TAR_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E echo copy bin/${TARGET} ${CMAKE_BINARY_DIR}/tmp/${TARGET}/)\n")
|
||||
|
||||
|
||||
SET(TARGET_EXE_NAME ${TARGET})
|
||||
IF(WIN32)
|
||||
FILE(APPEND ${RUN_TAR_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy bin/${TARGET}.exe ${CMAKE_BINARY_DIR}/tmp/${TARGET}/)\n")
|
||||
ELSE()
|
||||
FILE(APPEND ${RUN_TAR_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy bin/${TARGET} ${CMAKE_BINARY_DIR}/tmp/${TARGET}/)\n")
|
||||
SET(TARGET_EXE_NAME "${TARGET_EXE_NAME}.exe")
|
||||
ENDIF()
|
||||
|
||||
IF(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
|
||||
FILE(APPEND ${RUN_TAR_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E echo copy bin/${CMAKE_BUILD_TYPE}/${TARGET_EXE_NAME} ${CMAKE_BINARY_DIR}/tmp/${TARGET}/)\n")
|
||||
FILE(APPEND ${RUN_TAR_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy bin/${CMAKE_BUILD_TYPE}/${TARGET_EXE_NAME} ${CMAKE_BINARY_DIR}/tmp/${TARGET}/)\n")
|
||||
ELSE()
|
||||
FILE(APPEND ${RUN_TAR_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E echo copy bin/${TARGET_EXE_NAME} ${CMAKE_BINARY_DIR}/tmp/${TARGET}/)\n")
|
||||
FILE(APPEND ${RUN_TAR_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy bin/${TARGET_EXE_NAME} ${CMAKE_BINARY_DIR}/tmp/${TARGET}/)\n")
|
||||
ENDIF()
|
||||
|
||||
foreach(UPLOAD ${UPLOAD_FILES})
|
||||
FILE(APPEND ${RUN_TAR_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E echo copy ${UPLOAD} ${CMAKE_BINARY_DIR}/tmp/${TARGET}/)\n")
|
||||
@ -181,7 +187,7 @@ macro(gen_server APP TARGET)
|
||||
ENDIF()
|
||||
endforeach(UPLOAD ${UPLOAD_FILES})
|
||||
|
||||
FILE(APPEND ${RUN_TAR_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/tmp/ tar czfv ${TARGET}.tgz ${TARGET}/)\n")
|
||||
FILE(APPEND ${RUN_TAR_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/tmp/ tar czfv ${TARGET}.tgz ${TARGET})\n")
|
||||
FILE(APPEND ${RUN_TAR_COMMAND_FILE} "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/tmp/${TARGET}.tgz ${CMAKE_BINARY_DIR}/${TARGET}.tgz)\n")
|
||||
|
||||
add_custom_command(OUTPUT ${TARGET}.tgz
|
||||
|
Loading…
Reference in New Issue
Block a user