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

S
slguan 已提交
4
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
5
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/query/inc)
S
slguan 已提交
6
INCLUDE_DIRECTORIES(inc)
S
slguan 已提交
7

S
TD-1057  
Shengliang Guan 已提交
8
IF (TD_LINUX)
S
slguan 已提交
9 10
  AUX_SOURCE_DIRECTORY(./src SRC)
  LIST(REMOVE_ITEM SRC ./src/shellWindows.c)
S
slguan 已提交
11
  LIST(REMOVE_ITEM SRC ./src/shellDarwin.c)
12 13
  ADD_EXECUTABLE(shell ${SRC})

14 15 16 17 18 19 20
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 ()

H
Hui Li 已提交
21
  IF (TD_SOMODE_STATIC)
22
      TARGET_LINK_LIBRARIES(shell taos_static cJson ${LINK_LUA} ${LINK_JEMALLOC})
H
Hui Li 已提交
23
  ELSE ()
24
      TARGET_LINK_LIBRARIES(shell taos cJson ${LINK_LUA} ${LINK_JEMALLOC})
H
Hui Li 已提交
25
  ENDIF ()
26

S
slguan 已提交
27
  SET_TARGET_PROPERTIES(shell PROPERTIES OUTPUT_NAME taos)
S
TD-1037  
Shengliang Guan 已提交
28
ELSEIF (TD_WINDOWS)
29 30
  ADD_DEFINITIONS(-DUNICODE)
  ADD_DEFINITIONS(-D_UNICODE)
S
slguan 已提交
31 32 33
  LIST(APPEND SRC ./src/shellEngine.c)
  LIST(APPEND SRC ./src/shellMain.c)
  LIST(APPEND SRC ./src/shellWindows.c)
S
slguan 已提交
34
  ADD_EXECUTABLE(shell ${SRC})
35 36 37 38
  IF (TD_LINUX_64 AND JEMALLOC_ENABLED)
    ADD_DEPENDENCIES(shell jemalloc)
  ENDIF ()

39
  TARGET_LINK_LIBRARIES(shell taos_static cJson)
H
Hui Li 已提交
40 41 42

  IF (TD_POWER)
    SET_TARGET_PROPERTIES(shell PROPERTIES OUTPUT_NAME power)
43 44
  ELSEIF (TD_TQ)
    SET_TARGET_PROPERTIES(shell PROPERTIES OUTPUT_NAME tq)
45 46
  ELSEIF (TD_PRO)
    SET_TARGET_PROPERTIES(shell PROPERTIES OUTPUT_NAME prodbc)
47 48
  ELSEIF (TD_KH)
    SET_TARGET_PROPERTIES(shell PROPERTIES OUTPUT_NAME khclient)
49 50
  ELSEIF (TD_JH)
    SET_TARGET_PROPERTIES(shell PROPERTIES OUTPUT_NAME jh_taos)
51
  ELSE ()
H
Hui Li 已提交
52 53
    SET_TARGET_PROPERTIES(shell PROPERTIES OUTPUT_NAME taos)
  ENDIF ()
S
TD-1057  
Shengliang Guan 已提交
54
ELSEIF (TD_DARWIN)
S
slguan 已提交
55 56
  LIST(APPEND SRC ./src/shellEngine.c)
  LIST(APPEND SRC ./src/shellMain.c)
S
slguan 已提交
57 58 59
  LIST(APPEND SRC ./src/shellDarwin.c)
  LIST(APPEND SRC ./src/shellCommand.c)
  LIST(APPEND SRC ./src/shellImport.c)
S
TD-3309  
slguan 已提交
60
  LIST(APPEND SRC ./src/shellCheck.c)
S
slguan 已提交
61
  ADD_EXECUTABLE(shell ${SRC})
62
  # linking with dylib
63
  TARGET_LINK_LIBRARIES(shell taos cJson)
64 65
  # linking taos statically
  # TARGET_LINK_LIBRARIES(shell taos_static)
S
slguan 已提交
66
  SET_TARGET_PROPERTIES(shell PROPERTIES OUTPUT_NAME taos)
S
slguan 已提交
67
ENDIF ()
H
hzcheng 已提交
68