CMakeLists.txt 1.4 KB
Newer Older
1
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
2 3 4 5 6
PROJECT(TDengine)

INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/libcurl/include)

7
IF (TD_LINUX)
8 9
  AUX_SOURCE_DIRECTORY(. SRC)
  ADD_EXECUTABLE(taosdemox ${SRC})
10 11 12

  #find_program(HAVE_CURL NAMES curl)
  IF ((NOT TD_ARM_64) AND (NOT TD_ARM_32))
13 14 15 16
    ADD_DEFINITIONS(-DTD_LOWA_CURL)
    LINK_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/libcurl/lib)
    ADD_LIBRARY(curl STATIC IMPORTED)
    SET_PROPERTY(TARGET curl PROPERTY IMPORTED_LOCATION ${TD_COMMUNITY_DIR}/deps/libcurl/lib/libcurl.a)
17
    TARGET_LINK_LIBRARIES(taosdemox curl)
18
  ENDIF ()
19

20 21 22 23 24 25
  IF (TD_SOMODE_STATIC)
    TARGET_LINK_LIBRARIES(taosdemox taos_static cJson)
  ELSE ()
    TARGET_LINK_LIBRARIES(taosdemox taos cJson)
  ENDIF ()
ENDIF ()
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

IF (TD_DARWIN)
  # missing a few dependencies, such as <argp.h>
  # AUX_SOURCE_DIRECTORY(. SRC)
  # ADD_EXECUTABLE(taosdemox ${SRC})
  #
  # #find_program(HAVE_CURL NAMES curl)
  # IF ((NOT TD_ARM_64) AND (NOT TD_ARM_32))
  #   ADD_DEFINITIONS(-DTD_LOWA_CURL)
  #   LINK_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/libcurl/lib)
  #   ADD_LIBRARY(curl STATIC IMPORTED)
  #   SET_PROPERTY(TARGET curl PROPERTY IMPORTED_LOCATION ${TD_COMMUNITY_DIR}/deps/libcurl/lib/libcurl.a)
  #   TARGET_LINK_LIBRARIES(taosdemox curl)
  # ENDIF ()
  #
  # IF (TD_SOMODE_STATIC)
  #   TARGET_LINK_LIBRARIES(taosdemox taos_static cJson)
  # ELSE ()
  #   TARGET_LINK_LIBRARIES(taosdemox taos cJson)
  # ENDIF ()
ENDIF ()