This is an automated email from the ASF dual-hosted git repository.
isapego pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new ec56829581 IGNITE-20329 Fix ODBC build for MacOS (#2532)
ec56829581 is described below
commit ec56829581bfe700c04f5dac039dbcbe11131edf
Author: Andrey Hitrin <[email protected]>
AuthorDate: Fri Sep 1 17:34:14 2023 +0500
IGNITE-20329 Fix ODBC build for MacOS (#2532)
---
modules/platforms/cpp/cmake/find_odbc.cmake | 3 +++
modules/platforms/cpp/ignite/odbc/CMakeLists.txt | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/modules/platforms/cpp/cmake/find_odbc.cmake
b/modules/platforms/cpp/cmake/find_odbc.cmake
index b730f25ffc..45e0e871f8 100644
--- a/modules/platforms/cpp/cmake/find_odbc.cmake
+++ b/modules/platforms/cpp/cmake/find_odbc.cmake
@@ -27,6 +27,9 @@ if(WIN32)
endif()
### Try unixODBC or iODBC config program ######################################
+if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+ LINK_DIRECTORIES(/opt/local/lib)
+endif()
if (UNIX)
find_program(ODBC_CONFIG
NAMES odbc_config iodbc-config
diff --git a/modules/platforms/cpp/ignite/odbc/CMakeLists.txt
b/modules/platforms/cpp/ignite/odbc/CMakeLists.txt
index e0bf8cffb2..ffd5b9d799 100644
--- a/modules/platforms/cpp/ignite/odbc/CMakeLists.txt
+++ b/modules/platforms/cpp/ignite/odbc/CMakeLists.txt
@@ -19,6 +19,7 @@ project(ignite3-odbc)
set(TARGET ${PROJECT_NAME})
+include(find_odbc)
find_package(ODBC REQUIRED)
set(SOURCES
@@ -49,7 +50,7 @@ set(SOURCES
add_compile_definitions(CMAKE_PROJECT_VERSION="${CMAKE_PROJECT_VERSION}")
add_library(${TARGET}-obj OBJECT ${SOURCES})
-target_include_directories(${TARGET}-obj PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+target_include_directories(${TARGET}-obj PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
${ODBC_INCLUDE_DIRS})
add_library(${TARGET} SHARED $<TARGET_OBJECTS:${TARGET}-obj> module.def)