CMakeLists.txt 783 字节
Newer Older
H
hzcheng 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)

PROJECT(TDengine)

SET(SHELL_BUILD_NAME "ts")
SET(SHELL_FINAL_NAME "taos")
SET(SHELL_CMD_NAME "taos_cmd")
SET(SHELL_TARGET_NAME "taos_target")

AUX_SOURCE_DIRECTORY(. SRC)
INCLUDE_DIRECTORIES(${PRJ_HEADER_PATH} ../inc ../../client/inc)

ADD_EXECUTABLE(${SHELL_BUILD_NAME} ${SRC})
TARGET_LINK_LIBRARIES(${SHELL_BUILD_NAME} taos_static trpc tutil pthread)

ADD_CUSTOM_COMMAND(OUTPUT ${SHELL_CMD_NAME}
  POST_BUILD
  COMMAND echo "rename file"
  DEPENDS ${SHELL_BUILD_NAME}
  COMMAND ${CMAKE_COMMAND} -E rename ${EXECUTABLE_OUTPUT_PATH}/${SHELL_BUILD_NAME} ${EXECUTABLE_OUTPUT_PATH}/${SHELL_FINAL_NAME}
  COMMENT "rename ts to taos")

ADD_CUSTOM_TARGET(${SHELL_TARGET_NAME} ALL WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} DEPENDS ${SHELL_CMD_NAME})