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

S
TD-1057  
Shengliang Guan 已提交
4 5 6
AUX_SOURCE_DIRECTORY(src SRC)
ADD_LIBRARY(tutil ${SRC})
  
L
lihui 已提交
7
IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
S
Shengliang Guan 已提交
8
  TARGET_LINK_LIBRARIES(tutil pthread osdetail m rt lz4)
S
Shengliang Guan 已提交
9 10
  ADD_SUBDIRECTORY(tests)

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

S
slguan 已提交
26
ELSEIF (TD_WINDOWS_64)
S
Shengliang Guan 已提交
27
  TARGET_LINK_LIBRARIES(tutil iconv regex pthread osdetail winmm IPHLPAPI ws2_32 lz4)
S
slguan 已提交
28
ELSEIF(TD_DARWIN_64)
S
Shengliang Guan 已提交
29
  TARGET_LINK_LIBRARIES(tutil iconv pthread osdetail lz4)
S
slguan 已提交
30
ENDIF()