CMakeLists.txt 2.5 KB
Newer Older
1
CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
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)

13 14 15 16 17 18 19
IF (TD_LINUX_64 AND JEMALLOC_ENABLED)
  ADD_DEFINITIONS(-DTD_JEMALLOC_ENABLED -I${CMAKE_BINARY_DIR}/build/include -L${CMAKE_BINARY_DIR}/build/lib -Wl,-rpath,${CMAKE_BINARY_DIR}/build/lib -ljemalloc)
  SET(LINK_JEMALLOC "-L${CMAKE_BINARY_DIR}/build/lib -ljemalloc")
ELSE ()
  SET(LINK_JEMALLOC "")
ENDIF ()

S
TD-2837  
Shengliang Guan 已提交
20
ADD_EXECUTABLE(taosd ${SRC})
21

22 23 24 25
IF (TD_LINUX_64 AND JEMALLOC_ENABLED)
    ADD_DEPENDENCIES(taosd jemalloc)
ENDIF ()

26
IF (TD_BUILD_HTTP)
27
    TARGET_LINK_LIBRARIES(taosd mnode monitor http tsdb twal vnode cJson ${LINK_LUA} lz4 balance sync ${LINK_JEMALLOC})
28
ELSE ()
29
    TARGET_LINK_LIBRARIES(taosd mnode monitor tsdb twal vnode cJson ${LINK_LUA} lz4 balance sync ${LINK_JEMALLOC})
30
ENDIF ()
S
TD-1310  
Shengliang Guan 已提交
31

S
TD-2837  
Shengliang Guan 已提交
32 33 34 35
IF (TD_SOMODE_STATIC)
  TARGET_LINK_LIBRARIES(taosd taos_static)
ELSE ()
  TARGET_LINK_LIBRARIES(taosd taos)
H
Hui Li 已提交
36
ENDIF ()
37

S
TD-2837  
Shengliang Guan 已提交
38 39 40
IF (TD_ACCOUNT)
  TARGET_LINK_LIBRARIES(taosd account)
ENDIF ()
41

S
TD-2837  
Shengliang Guan 已提交
42 43 44
IF (TD_GRANT)
  TARGET_LINK_LIBRARIES(taosd grant)
ENDIF ()
45

wafwerar's avatar
wafwerar 已提交
46 47 48 49
IF (TD_USB_DONGLE)
  TARGET_LINK_LIBRARIES(taosd usb_dongle)
ENDIF ()

S
Shengliang Guan 已提交
50
IF (TD_MQTT)
S
TD-2837  
Shengliang Guan 已提交
51
  TARGET_LINK_LIBRARIES(taosd mqtt)
H
Hui Li 已提交
52
ENDIF ()
53

S
Shengliang Guan 已提交
54 55 56 57
IF (TD_TOPIC)
  TARGET_LINK_LIBRARIES(taosd topic)
ENDIF ()

S
TD-3246  
Shengliang Guan 已提交
58 59 60 61
IF (TD_MODULE AND TD_LINUX)
  TARGET_LINK_LIBRARIES(taosd module dl)
ENDIF ()

S
TD-2837  
Shengliang Guan 已提交
62 63 64 65 66 67 68 69 70 71 72 73
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
S
Shengliang Guan 已提交
74
    COMMAND ${CMAKE_COMMAND} -E echo monitor 0  >> ${TD_TESTS_OUTPUT_DIR}/cfg/taos.cfg
S
TD-2837  
Shengliang Guan 已提交
75 76
    COMMENT "prepare taosd environment")
ADD_CUSTOM_TARGET(${PREPARE_ENV_TARGET} ALL WORKING_DIRECTORY ${TD_EXECUTABLE_OUTPUT_PATH} DEPENDS ${PREPARE_ENV_CMD})