CMakeLists.txt 1.6 KB
Newer Older
F
freemine 已提交
1 2 3
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine)

4 5 6 7 8 9 10 11 12 13 14 15
IF (TD_LINUX_64)
  find_program(HAVE_ODBCINST NAMES odbcinst)
  IF (HAVE_ODBCINST)
    include(CheckSymbolExists)
    # shall we revert CMAKE_REQUIRED_LIBRARIES and how?
    set(CMAKE_REQUIRED_LIBRARIES odbc)
    check_symbol_exists(SQLExecute "sql.h" HAVE_ODBC_DEV)
    if(NOT (HAVE_ODBC_DEV))
      unset(HAVE_ODBC_DEV CACHE)
      message(WARNING "unixodbc-dev is not installed yet, you may install it under ubuntu by typing: sudo apt install unixodbc-dev")
    else ()
      message(STATUS "unixodbc/unixodbc-dev are installed, and odbc connector will be built")
16 17 18 19
      find_package(FLEX)
      if(NOT FLEX_FOUND)
        message(FATAL_ERROR "you need to install flex first")
      else ()
20 21
        SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wconversion")
        SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wconversion")
22 23 24
        ADD_SUBDIRECTORY(src)
        ADD_SUBDIRECTORY(tests)
      endif()
25 26
    endif()
  ELSE ()
F
freemine 已提交
27
    message(WARNING "unixodbc is not installed yet, you may install it under ubuntu by typing: sudo apt install unixodbc")
28 29
  ENDIF ()
ENDIF ()
F
freemine 已提交
30

F
freemine 已提交
31
IF (TD_WINDOWS_64)
32 33 34 35 36 37 38 39
  find_package(ODBC)
  if (NOT ODBC_FOUND)
    message(FATAL_ERROR "you need to install ODBC first")
  else ()
    message(STATUS "ODBC_INCLUDE_DIRS: ${ODBC_INCLUDE_DIRS}")
    message(STATUS "ODBC_LIBRARIES: ${ODBC_LIBRARIES}")
    message(STATUS "ODBC_CONFIG: ${ODBC_CONFIG}")
  endif ()
F
freemine 已提交
40 41 42 43 44 45 46 47
  find_package(FLEX)
  if(NOT FLEX_FOUND)
    message(FATAL_ERROR "you need to install flex first")
  else ()
    ADD_SUBDIRECTORY(src)
    ADD_SUBDIRECTORY(tests)
  endif()
ENDIF ()