diff --git a/src/connector/odbc/CMakeLists.txt b/src/connector/odbc/CMakeLists.txt index 5e8095c7ddfa577767eb6ca03624c0c7278e174d..3f0439dd961f663b6d7f03da448d7911420091fb 100644 --- a/src/connector/odbc/CMakeLists.txt +++ b/src/connector/odbc/CMakeLists.txt @@ -58,7 +58,7 @@ macro(check_odbc_requirement) check_symbol_exists(SQLExecute "sql.h" HAVE_ODBC_DEV) IF (NOT HAVE_ODBC_DEV) - message(WARNING "odbc requirement not satisfied, check detail in ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log") + message(WARNING "odbc requirement not satisfied, please install unixodbc-dev. Check detail in ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log") return () ENDIF () diff --git a/src/connector/odbc/examples/c/CMakeLists.txt b/src/connector/odbc/examples/c/CMakeLists.txt index 42985496554adf5023a5078f7ec7650413a18bb4..999f0d19f7473d3af4acb42e1fcb4e9a0e9c2c64 100644 --- a/src/connector/odbc/examples/c/CMakeLists.txt +++ b/src/connector/odbc/examples/c/CMakeLists.txt @@ -4,7 +4,11 @@ ADD_EXECUTABLE(tcodbc main.c ../../src/todbc_log.c) IF (TD_LINUX OR TD_DARWIN) target_include_directories(tcodbc PRIVATE ${ODBC_INCLUDE_DIRECTORY}) - target_link_directories(tcodbc PUBLIC ${ODBC_LIBRARY_DIRECTORY}) + IF (CMAKE_VERSION VERSION_LESS 3.13) + link_directories(AFTER ${ODBC_LIBRARY_DIRECTORY}) + ELSE () + target_link_directories(tcodbc PUBLIC ${ODBC_LIBRARY_DIRECTORY}) + ENDIF () TARGET_LINK_LIBRARIES(tcodbc taos odbc) ENDIF () diff --git a/src/connector/odbc/src/CMakeLists.txt b/src/connector/odbc/src/CMakeLists.txt index f0df94795ac35f2b2e9537b7d437c34e2af193e2..a616c7df48b2fb3f70e0b109d81b71e040ae004d 100644 --- a/src/connector/odbc/src/CMakeLists.txt +++ b/src/connector/odbc/src/CMakeLists.txt @@ -19,7 +19,11 @@ IF (TD_LINUX_64) SET_TARGET_PROPERTIES(todbc PROPERTIES VERSION ${TD_VER_NUMBER} SOVERSION 1) TARGET_LINK_LIBRARIES(todbc todbc_base taos odbcinst) target_include_directories(todbc PRIVATE . ${ODBC_INCLUDE_DIRECTORY}) - target_link_directories(todbc PUBLIC ${ODBC_LIBRARY_DIRECTORY}) + IF (CMAKE_VERSION VERSION_LESS 3.13) + link_directories(AFTER ${ODBC_LIBRARY_DIRECTORY}) + ELSE () + target_link_directories(todbc PUBLIC ${ODBC_LIBRARY_DIRECTORY}) + ENDIF () install(CODE "execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/install.sh ${CMAKE_BINARY_DIR})") ENDIF () diff --git a/src/connector/odbc/tools/CMakeLists.txt b/src/connector/odbc/tools/CMakeLists.txt index d49d334ef5019786a557263d0c04a7e71c9e715f..790620dd1d72db0ecc42f95a6ac569a6a821818e 100644 --- a/src/connector/odbc/tools/CMakeLists.txt +++ b/src/connector/odbc/tools/CMakeLists.txt @@ -5,7 +5,11 @@ ADD_EXECUTABLE(tconv tconv.c) IF (TD_LINUX OR TD_DARWIN) target_include_directories(todbcinst PRIVATE . ${ODBC_INCLUDE_DIRECTORY} ${ODBCINST_INCLUDE_DIRECTORY}) - target_link_directories(todbcinst PUBLIC ${ODBC_LIBRARY_DIRECTORY} ${ODBCINST_LIBRARY_DIRECTORY}) + IF (CMAKE_VERSION VERSION_LESS 3.13) + link_directories(AFTER ${ODBC_LIBRARY_DIRECTORY}) + ELSE () + target_link_directories(todbcinst PUBLIC ${ODBC_LIBRARY_DIRECTORY} ${ODBCINST_LIBRARY_DIRECTORY}) + ENDIF () TARGET_LINK_LIBRARIES(todbcinst odbc odbcinst) ENDIF ()