Skip to content

Commit

Permalink
Fixed CMake not finding odbcinst from the custom-built UnixODBC.
Browse files Browse the repository at this point in the history
  • Loading branch information
user committed Jan 15, 2025
1 parent b511765 commit e8d21a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ endif()
set(LINK_LIB_LIST "")

if(ODBC_FOUND)
find_library(ODBCINST_LIB NAMES odbcinst libodbcinst)
message(STATUS "ODBC library found at: " ${ODBC_LIBRARIES})
get_filename_component(ODBC_LIB_DIR ${ODBC_LIBRARIES} DIRECTORY)
message(STATUS "ODBC library path: " ${ODBC_LIB_DIR})
find_library(ODBCINST_LIB NAMES odbcinst libodbcinst HINTS ${ODBC_LIB_DIR})
if(ODBCINST_LIB)
list(APPEND LINK_LIB_LIST ${ODBCINST_LIB})
add_definitions(-DODBC_LINK_ODBCINST)
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ endif()
set(LINK_LIB_LIST "")

if(ODBC_FOUND)
find_library(ODBCINST_LIB NAMES odbcinst libodbcinst)
message(STATUS "ODBC library found at: " ${ODBC_LIBRARIES})
get_filename_component(ODBC_LIB_DIR ${ODBC_LIBRARIES} DIRECTORY)
message(STATUS "ODBC library path: " ${ODBC_LIB_DIR})
find_library(ODBCINST_LIB NAMES odbcinst libodbcinst HINTS ${ODBC_LIB_DIR})
if(ODBCINST_LIB)
list(APPEND LINK_LIB_LIST ${ODBCINST_LIB})
add_definitions(-DODBC_LINK_ODBCINST)
Expand Down

0 comments on commit e8d21a3

Please sign in to comment.