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

H
Hui Li 已提交
4
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/rpc/inc)
S
TD-2861  
Shengliang Guan 已提交
5
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/sync/inc)
6
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/rmonotonic/inc)
7
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/TSZ/sz/include)
8

S
TD-1057  
Shengliang Guan 已提交
9 10
AUX_SOURCE_DIRECTORY(src SRC)
ADD_LIBRARY(tutil ${SRC})
11 12

TARGET_LINK_LIBRARIES(tutil pthread os lz4 z rmonotonic ${VAR_TSZ} )
T
tickduan 已提交
13 14


15

S
TD-1057  
Shengliang Guan 已提交
16
IF (TD_LINUX)
S
TD-1310  
Shengliang Guan 已提交
17
  TARGET_LINK_LIBRARIES(tutil m rt)
18
  ADD_SUBDIRECTORY(tests)
S
Shengliang Guan 已提交
19

20 21 22 23 24 25 26
  FIND_PATH(ICONV_INCLUDE_EXIST iconv.h /usr/include/ /usr/local/include/)
  IF (ICONV_INCLUDE_EXIST)
    FIND_PATH(ICONV_LIBRARY_A_EXIST libiconv.a /usr/lib/ /usr/local/lib/ /lib64)
    FIND_PATH(ICONV_LIBRARY_SO_EXIST libiconv.so /usr/lib/ /usr/local/lib/ /lib64)
    IF (ICONV_LIBRARY_A_EXIST OR ICONV_LIBRARY_SO_EXIST)
      MESSAGE(STATUS "Use the installed libiconv library")
      TARGET_LINK_LIBRARIES(tutil iconv)
S
slguan 已提交
27
    ELSE ()
28 29
      # libiconv library is already included in GLIBC,
      MESSAGE(STATUS "Use the iconv functions in GLIBC")
S
slguan 已提交
30
    ENDIF ()
31 32
  ELSE ()
    MESSAGE(STATUS "Failed to find iconv, use default encoding method")
H
hzcheng 已提交
33
  ENDIF ()
H
hjxilinx 已提交
34

S
TD-1057  
Shengliang Guan 已提交
35
ELSEIF (TD_WINDOWS)
S
TD-1310  
Shengliang Guan 已提交
36
  TARGET_LINK_LIBRARIES(tutil iconv regex winmm IPHLPAPI ws2_32 wepoll)
S
TD-1057  
Shengliang Guan 已提交
37
ELSEIF(TD_DARWIN)
38
  TARGET_LINK_LIBRARIES(tutil m)
S
TD-1310  
Shengliang Guan 已提交
39
  TARGET_LINK_LIBRARIES(tutil iconv)
S
slguan 已提交
40
ENDIF()
S
TD-1767  
Shengliang Guan 已提交
41 42 43

IF (TD_STORAGE)
  TARGET_LINK_LIBRARIES(tutil storage)
T
tickduan 已提交
44
ENDIF ()