CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) 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") 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() ELSE () message(WARNING "unixodbc is not installed yet, you may install it under ubuntu by typing: sudo apt install unixodbc") ENDIF () ENDIF ()