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

S
slguan 已提交
4 5
INCLUDE_DIRECTORIES(inc)
INCLUDE_DIRECTORIES(jni)
6
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/query/inc)
7
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/plugins/http/inc)
S
slguan 已提交
8
AUX_SOURCE_DIRECTORY(src SRC)
S
slguan 已提交
9

S
TD-1057  
Shengliang Guan 已提交
10
IF (TD_LINUX)
S
slguan 已提交
11
  INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/jni/linux)
S
slguan 已提交
12 13

  # set the static lib name
S
slguan 已提交
14
  ADD_LIBRARY(taos_static STATIC ${SRC})
15
  TARGET_LINK_LIBRARIES(taos_static common query trpc tutil pthread m rt ${VAR_TSZ})
S
slguan 已提交
16
  SET_TARGET_PROPERTIES(taos_static PROPERTIES OUTPUT_NAME "taos_static")
S
slguan 已提交
17
  SET_TARGET_PROPERTIES(taos_static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
S
slguan 已提交
18

S
slguan 已提交
19 20
  # generate dynamic library (*.so)
  ADD_LIBRARY(taos SHARED ${SRC})
sangshuduo's avatar
sangshuduo 已提交
21
  TARGET_LINK_LIBRARIES(taos common query trpc tutil pthread m rt)
22 23 24
  IF (TD_LINUX_64)
    TARGET_LINK_LIBRARIES(taos lua)
  ENDIF ()
H
Haojun Liao 已提交
25

S
slguan 已提交
26 27 28 29 30
  SET_TARGET_PROPERTIES(taos PROPERTIES CLEAN_DIRECT_OUTPUT 1)

  #set version of .so
  #VERSION    so version
  #SOVERSION  api version
H
Hui Li 已提交
31 32
  #MESSAGE(STATUS "build version ${TD_VER_NUMBER}")
  SET_TARGET_PROPERTIES(taos PROPERTIES VERSION ${TD_VER_NUMBER} SOVERSION 1)
33 34 35

  ADD_SUBDIRECTORY(tests)

36 37 38 39 40
ELSEIF (TD_DARWIN)
  INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/jni/linux)

  # set the static lib name
  ADD_LIBRARY(taos_static STATIC ${SRC})
Y
yihaoDeng 已提交
41
  TARGET_LINK_LIBRARIES(taos_static common query trpc tutil pthread m lua)
42 43 44 45 46
  SET_TARGET_PROPERTIES(taos_static PROPERTIES OUTPUT_NAME "taos_static")
  SET_TARGET_PROPERTIES(taos_static PROPERTIES CLEAN_DIRECT_OUTPUT 1)

  # generate dynamic library (*.dylib)
  ADD_LIBRARY(taos SHARED ${SRC})
Y
yihaoDeng 已提交
47
  TARGET_LINK_LIBRARIES(taos common query trpc tutil pthread m lua)
48 49 50 51 52 53 54 55 56 57
  SET_TARGET_PROPERTIES(taos PROPERTIES CLEAN_DIRECT_OUTPUT 1)

  #set version of .dylib
  #VERSION    dylib version
  #SOVERSION  dylib version
  #MESSAGE(STATUS "build version ${TD_VER_NUMBER}")
  SET_TARGET_PROPERTIES(taos PROPERTIES VERSION ${TD_VER_NUMBER} SOVERSION 1)

  ADD_SUBDIRECTORY(tests)

S
TD-1037  
Shengliang Guan 已提交
58
ELSEIF (TD_WINDOWS)
S
slguan 已提交
59 60
  INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/jni/windows)
  INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/jni/windows/win32)
61 62 63

  CONFIGURE_FILE("${TD_COMMUNITY_DIR}/src/client/src/taos.rc.in" "${TD_COMMUNITY_DIR}/src/client/src/taos.rc")

S
slguan 已提交
64
  ADD_LIBRARY(taos_static STATIC ${SRC})
S
TD-1057  
Shengliang Guan 已提交
65
  TARGET_LINK_LIBRARIES(taos_static trpc tutil query)
S
slguan 已提交
66 67

  # generate dynamic library (*.dll)
68
  ADD_LIBRARY(taos SHARED ${SRC} ${TD_COMMUNITY_DIR}/src/client/src/taos.rc)
L
[#1054]  
lihui 已提交
69 70 71
  IF (NOT TD_GODLL)
    SET_TARGET_PROPERTIES(taos PROPERTIES LINK_FLAGS /DEF:${TD_COMMUNITY_DIR}/src/client/src/taos.def)
  ENDIF ()
Y
yihaoDeng 已提交
72
  TARGET_LINK_LIBRARIES(taos trpc tutil query lua)
S
slguan 已提交
73

S
TD-1057  
Shengliang Guan 已提交
74
ELSEIF (TD_DARWIN)
S
slguan 已提交
75
  SET(CMAKE_MACOSX_RPATH 1)
S
slguan 已提交
76
  INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/jni/linux)
S
slguan 已提交
77 78

  ADD_LIBRARY(taos_static STATIC ${SRC})
Y
yihaoDeng 已提交
79
  TARGET_LINK_LIBRARIES(taos_static query trpc tutil pthread m lua)
S
slguan 已提交
80 81 82 83
  SET_TARGET_PROPERTIES(taos_static PROPERTIES OUTPUT_NAME "taos_static")

  # generate dynamic library (*.dylib)
  ADD_LIBRARY(taos SHARED ${SRC})
Y
yihaoDeng 已提交
84
  TARGET_LINK_LIBRARIES(taos query trpc tutil pthread m lua)
S
slguan 已提交
85 86 87 88 89 90

  SET_TARGET_PROPERTIES(taos PROPERTIES CLEAN_DIRECT_OUTPUT 1)

  #set version of .so
  #VERSION    so version
  #SOVERSION  api version
H
Hui Li 已提交
91 92
  #MESSAGE(STATUS "build version ${TD_VER_NUMBER}")
  SET_TARGET_PROPERTIES(taos PROPERTIES VERSION ${TD_VER_NUMBER} SOVERSION 1)
S
slguan 已提交
93
ENDIF ()
H
hzcheng 已提交
94