CMakeLists.txt 2.0 KB
Newer Older
H
Hongze Cheng 已提交
1
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
H
hzcheng 已提交
2 3
PROJECT(TDengine)

S
#1177  
slguan 已提交
4
IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
S
#1177  
slguan 已提交
5
  INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
S
#1177  
slguan 已提交
6
  INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
S
slguan 已提交
7
  INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc)
8
  INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/query/inc)
sangshuduo's avatar
sangshuduo 已提交
9
  INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/mnode/inc)
S
slguan 已提交
10
  INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/vnode/tsdb/inc)
S
slguan 已提交
11
  INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/common/inc)
S
#1177  
slguan 已提交
12
  INCLUDE_DIRECTORIES(${TD_ENTERPRISE_DIR}/src/inc)
S
#1177  
slguan 已提交
13 14 15
  INCLUDE_DIRECTORIES(inc)
  AUX_SOURCE_DIRECTORY(src SRC)

S
slguan 已提交
16
  ADD_EXECUTABLE(taosd ${SRC})
S
slguan 已提交
17
  TARGET_LINK_LIBRARIES(taosd mnode taos_static monitor http tsdb twal vnode)
S
#1177  
slguan 已提交
18

S
slguan 已提交
19 20 21 22 23 24 25
  IF (TD_ACCOUNT)
    TARGET_LINK_LIBRARIES(taosd account)
  ENDIF ()
  IF (TD_GRANT)
    TARGET_LINK_LIBRARIES(taosd grant)
  ENDIF ()

S
slguan 已提交
26 27 28
  IF (TD_CLUSTER)
    TARGET_LINK_LIBRARIES(taosd cluster)
  ENDIF ()
29 30
  
  IF (TD_VPEER)
S
slguan 已提交
31
    TARGET_LINK_LIBRARIES(taosd balance sync)
32
  ENDIF ()
S
#1177  
slguan 已提交
33

S
slguan 已提交
34 35 36 37
    IF (TD_MPEER)
    TARGET_LINK_LIBRARIES(taosd mpeer sync)
  ENDIF ()

S
#1177  
slguan 已提交
38 39 40 41 42 43 44
  SET(PREPARE_ENV_CMD "prepare_env_cmd")
  SET(PREPARE_ENV_TARGET "prepare_env_target")
  ADD_CUSTOM_COMMAND(OUTPUT ${PREPARE_ENV_CMD}
      POST_BUILD
      COMMAND echo "make test directory"
      DEPENDS taosd
      COMMAND ${CMAKE_COMMAND} -E make_directory ${TD_TESTS_OUTPUT_DIR}/cfg/
S
slguan 已提交
45
      COMMAND ${CMAKE_COMMAND} -E make_directory ${TD_TESTS_OUTPUT_DIR}/log/
S
#1177  
slguan 已提交
46 47 48 49 50 51 52 53 54 55
      COMMAND ${CMAKE_COMMAND} -E make_directory ${TD_TESTS_OUTPUT_DIR}/data/
      COMMAND ${CMAKE_COMMAND} -E echo dataDir ${TD_TESTS_OUTPUT_DIR}/data > ${TD_TESTS_OUTPUT_DIR}/cfg/taos.cfg
      COMMAND ${CMAKE_COMMAND} -E echo logDir ${TD_TESTS_OUTPUT_DIR}/log  >> ${TD_TESTS_OUTPUT_DIR}/cfg/taos.cfg
      COMMAND ${CMAKE_COMMAND} -E echo charset UTF-8  >> ${TD_TESTS_OUTPUT_DIR}/cfg/taos.cfg
      COMMENT "prepare taosd environment")
  ADD_CUSTOM_TARGET(${PREPARE_ENV_TARGET} ALL WORKING_DIRECTORY ${TD_EXECUTABLE_OUTPUT_PATH} DEPENDS ${PREPARE_ENV_CMD})

ENDIF ()