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

S
slguan 已提交
4
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
S
Shengliang Guan 已提交
5
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/os/inc)
S
slguan 已提交
6
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc)
S
slguan 已提交
7
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/common/inc)
S
slguan 已提交
8

L
lihui 已提交
9
IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
S
slguan 已提交
10 11
  INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/cJson/inc)
  INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/lz4/inc)
S
slguan 已提交
12 13
  AUX_SOURCE_DIRECTORY(src SRC)
  ADD_LIBRARY(tutil ${SRC})
S
Shengliang Guan 已提交
14
  TARGET_LINK_LIBRARIES(tutil pthread osdetail m rt lz4)
S
Shengliang Guan 已提交
15 16
  ADD_SUBDIRECTORY(tests)

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

S
slguan 已提交
32 33 34 35 36
ELSEIF (TD_WINDOWS_64)
  INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/pthread)
  INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/iconv)
  INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/regex)
  INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
S
Shengliang Guan 已提交
37
  AUX_SOURCE_DIRECTORY(src SRC)
S
slguan 已提交
38
  ADD_LIBRARY(tutil ${SRC}) 
S
Shengliang Guan 已提交
39
  TARGET_LINK_LIBRARIES(tutil iconv regex pthread osdetail winmm IPHLPAPI ws2_32 lz4)
S
slguan 已提交
40
ELSEIF(TD_DARWIN_64)
S
Shengliang Guan 已提交
41
  AUX_SOURCE_DIRECTORY(src SRC)
S
slguan 已提交
42
  ADD_LIBRARY(tutil ${SRC})
S
Shengliang Guan 已提交
43
  TARGET_LINK_LIBRARIES(tutil iconv pthread osdetail lz4)
S
slguan 已提交
44
ENDIF()
S
slguan 已提交
45

S
slguan 已提交
46
#  TARGET_LINK_LIBRARIES(tutil mstorage)