CMakeLists.txt 3.2 KB
Newer Older
1
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
H
hzcheng 已提交
2 3
PROJECT(TDengine)

S
TD-1057  
Shengliang Guan 已提交
4 5 6
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/query/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/mnode/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/tsdb/inc)
B
Bomin Zhang 已提交
7
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/sync/inc)
S
TD-1057  
Shengliang Guan 已提交
8
INCLUDE_DIRECTORIES(${TD_ENTERPRISE_DIR}/src/inc)
S
#1177  
slguan 已提交
9

S
TD-1057  
Shengliang Guan 已提交
10 11 12
INCLUDE_DIRECTORIES(inc)
AUX_SOURCE_DIRECTORY(src SRC)

S
TD-1207  
Shengliang Guan 已提交
13
IF (TD_LINUX OR TD_WINDOWS)
S
slguan 已提交
14
  ADD_EXECUTABLE(taosd ${SRC})
15
  TARGET_LINK_LIBRARIES(taosd mnode monitor http tsdb twal vnode cJson lz4 balance sync)
S
TD-1310  
Shengliang Guan 已提交
16

H
Hui Li 已提交
17
  IF (TD_SOMODE_STATIC)
S
TD-1310  
Shengliang Guan 已提交
18
    TARGET_LINK_LIBRARIES(taosd taos_static)
H
Hui Li 已提交
19
  ELSE ()
S
TD-1310  
Shengliang Guan 已提交
20
    TARGET_LINK_LIBRARIES(taosd taos)
H
Hui Li 已提交
21
  ENDIF ()
S
#1177  
slguan 已提交
22

S
slguan 已提交
23 24 25
  IF (TD_ACCOUNT)
    TARGET_LINK_LIBRARIES(taosd account)
  ENDIF ()
26

S
slguan 已提交
27 28 29 30
  IF (TD_GRANT)
    TARGET_LINK_LIBRARIES(taosd grant)
  ENDIF ()

S
TD-1207  
Shengliang Guan 已提交
31
  IF (TD_LINUX AND TD_MQTT)
S
TD-1310  
Shengliang Guan 已提交
32 33 34
    TARGET_LINK_LIBRARIES(taosd mqtt)
  ENDIF ()

S
#1177  
slguan 已提交
35 36 37 38 39 40 41
  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 已提交
42
      COMMAND ${CMAKE_COMMAND} -E make_directory ${TD_TESTS_OUTPUT_DIR}/log/
S
#1177  
slguan 已提交
43 44 45 46 47 48
      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})
H
Hui Li 已提交
49
ENDIF ()
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88

IF (TD_DARWIN)
  ADD_EXECUTABLE(taosd ${SRC})
  TARGET_LINK_LIBRARIES(taosd mnode monitor http tsdb twal vnode cJson lz4 balance sync)

  IF (TD_SOMODE_STATIC)
    TARGET_LINK_LIBRARIES(taosd taos_static)
  ELSE ()
    TARGET_LINK_LIBRARIES(taosd taos)
  ENDIF ()

  IF (TD_ACCOUNT)
    TARGET_LINK_LIBRARIES(taosd account)
  ENDIF ()

  IF (TD_GRANT)
    TARGET_LINK_LIBRARIES(taosd grant)
  ENDIF ()

  IF (TD_MQTT)
    TARGET_LINK_LIBRARIES(taosd mqtt)
  ENDIF ()

  # 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/
  #     COMMAND ${CMAKE_COMMAND} -E make_directory ${TD_TESTS_OUTPUT_DIR}/log/
  #     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 ()