2022-01-17 20:59:41 +00:00
|
|
|
if (NOT ENABLE_ODBC)
|
2021-04-20 11:07:05 +00:00
|
|
|
return ()
|
|
|
|
endif ()
|
|
|
|
|
2022-01-18 06:49:10 +00:00
|
|
|
if (NOT TARGET ch_contrib::unixodbc)
|
2021-03-22 11:40:29 +00:00
|
|
|
message(FATAL_ERROR "Configuration error: unixodbc is not a target")
|
|
|
|
endif()
|
|
|
|
|
2022-06-01 08:10:06 +00:00
|
|
|
set (LIBRARY_DIR "${ClickHouse_SOURCE_DIR}/contrib/nanodbc")
|
|
|
|
|
2021-03-22 11:40:29 +00:00
|
|
|
set (SRCS
|
2021-04-24 19:47:52 +00:00
|
|
|
"${LIBRARY_DIR}/nanodbc/nanodbc.cpp"
|
2021-03-22 11:40:29 +00:00
|
|
|
)
|
|
|
|
|
2022-01-20 14:25:46 +00:00
|
|
|
add_library(_nanodbc ${SRCS})
|
|
|
|
target_link_libraries(_nanodbc PUBLIC ch_contrib::unixodbc)
|
|
|
|
target_include_directories(_nanodbc SYSTEM PUBLIC "${LIBRARY_DIR}/")
|
|
|
|
add_library(ch_contrib::nanodbc ALIAS _nanodbc)
|