CMakeLists.txt 2.1 KB
Newer Older
H
hzcheng 已提交
1 2
PROJECT(TDengine)

3
IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
4
  CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
5
ELSE ()
6
  CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
7 8
ENDIF ()

H
hzcheng 已提交
9
ADD_SUBDIRECTORY(zlib-1.2.11)
S
slguan 已提交
10 11 12
ADD_SUBDIRECTORY(pthread)
ADD_SUBDIRECTORY(regex)
ADD_SUBDIRECTORY(iconv)
S
slguan 已提交
13 14
ADD_SUBDIRECTORY(lz4)
ADD_SUBDIRECTORY(cJson)
S
TD-1057  
Shengliang Guan 已提交
15
ADD_SUBDIRECTORY(wepoll)
S
Shengliang Guan 已提交
16
ADD_SUBDIRECTORY(MsvcLibX)
17
ADD_SUBDIRECTORY(rmonotonic)
18
ADD_SUBDIRECTORY(lua)
19

S
TD-1310  
Shengliang Guan 已提交
20
IF (TD_LINUX AND TD_MQTT)
S
slguan 已提交
21
  ADD_SUBDIRECTORY(MQTT-C)
22 23 24 25 26
ENDIF ()

IF (TD_DARWIN AND TD_MQTT)
  ADD_SUBDIRECTORY(MQTT-C)
ENDIF ()
27

28
IF (TD_AVRO_SUPPORT)
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
  MESSAGE("")
  MESSAGE("${Green} ENABLE avro format support ${ColourReset}")
  MESSAGE("")
  include(ExternalProject)
  ExternalProject_Add(
    apache-avro
    PREFIX          "avro"
    SOURCE_DIR      ${CMAKE_CURRENT_SOURCE_DIR}/avro/lang/c
    BUILD_IN_SOURCE 1
    PATCH_COMMAND
        COMMAND   git clean -f -d
        COMMAND   sed -i.bak -e "/TARGETS avroappend/d" ${CMAKE_CURRENT_SOURCE_DIR}/avro/lang/c/src/CMakeLists.txt
        COMMAND   sed -i.bak -e "/TARGETS avrocat/d" ${CMAKE_CURRENT_SOURCE_DIR}/avro/lang/c/src/CMakeLists.txt
        COMMAND   sed -i.bak -e "/TARGETS avromod/d" ${CMAKE_CURRENT_SOURCE_DIR}/avro/lang/c/src/CMakeLists.txt
        COMMAND   sed -i.bak -e "/TARGETS avropipe/d" ${CMAKE_CURRENT_SOURCE_DIR}/avro/lang/c/src/CMakeLists.txt
    CONFIGURE_COMMAND   cmake -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/build
    )
ELSE ()
  MESSAGE("")
  MESSAGE("${Yellow} NO avro format support ${ColourReset}")
  MESSAGE("")
ENDIF ()

52
IF (TD_LINUX_64 AND JEMALLOC_ENABLED)
53 54 55
  MESSAGE("")
  MESSAGE("${Green} ENABLE jemalloc ${ColourReset}")
  MESSAGE("")
56
  MESSAGE("setup deps/jemalloc, current source dir:" ${CMAKE_CURRENT_SOURCE_DIR})
57 58 59 60 61 62 63 64 65
  MESSAGE("binary dir:" ${CMAKE_BINARY_DIR})
  ExternalProject_Add(jemalloc
    PREFIX        "jemalloc"
    SOURCE_DIR    ${CMAKE_CURRENT_SOURCE_DIR}/jemalloc
    BUILD_IN_SOURCE     1
    CONFIGURE_COMMAND   ./autogen.sh COMMAND ./configure --prefix=${CMAKE_BINARY_DIR}/build/
    BUILD_COMMAND       ${MAKE}
  )
ENDIF ()
T
tickduan 已提交
66

67
IF (${TSZ_ENABLED} MATCHES "true")
68 69
  ADD_SUBDIRECTORY(TSZ)
ENDIF()