CMakeLists.txt 1.2 KB
Newer Older
1
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
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)
S
TD-1057  
Shengliang Guan 已提交
6 7
AUX_SOURCE_DIRECTORY(src SRC)
ADD_LIBRARY(tutil ${SRC})
S
TD-1574  
Shengliang Guan 已提交
8
TARGET_LINK_LIBRARIES(tutil pthread osdetail lz4 z)
9

S
TD-1057  
Shengliang Guan 已提交
10
IF (TD_LINUX)
S
TD-1310  
Shengliang Guan 已提交
11
  TARGET_LINK_LIBRARIES(tutil m rt)
H
TD-1437  
Hongze Cheng 已提交
12
  # ADD_SUBDIRECTORY(tests)
S
Shengliang Guan 已提交
13

14 15 16 17 18 19 20
  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 已提交
21
    ELSE ()
22 23
      # libiconv library is already included in GLIBC,
      MESSAGE(STATUS "Use the iconv functions in GLIBC")
S
slguan 已提交
24
    ENDIF ()
25 26
  ELSE ()
    MESSAGE(STATUS "Failed to find iconv, use default encoding method")
H
hzcheng 已提交
27
  ENDIF ()
H
hjxilinx 已提交
28

S
TD-1057  
Shengliang Guan 已提交
29
ELSEIF (TD_WINDOWS)
S
TD-1310  
Shengliang Guan 已提交
30
  TARGET_LINK_LIBRARIES(tutil iconv regex winmm IPHLPAPI ws2_32 wepoll)
S
TD-1057  
Shengliang Guan 已提交
31
ELSEIF(TD_DARWIN)
32
  TARGET_LINK_LIBRARIES(tutil m)
S
TD-1310  
Shengliang Guan 已提交
33
  TARGET_LINK_LIBRARIES(tutil iconv)
S
slguan 已提交
34
ENDIF()