Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LinZhihao-723 committed Nov 10, 2024
1 parent 7ea3941 commit 6f8306c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions components/core/cmake/Modules/FindMariaDBClient.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ include(cmake/Modules/FindLibraryDependencies.cmake)
find_package(PkgConfig)
pkg_check_modules(mariadbclient_PKGCONF QUIET "lib${mariadbclient_LIBNAME}")

if (NOT mariadbclient_PKGCONF_FOUND AND APPLE)
execute_process(COMMAND brew --prefix mariadb-connector-c OUTPUT_VARIABLE mariadb_MACOS_PREFIX)
string(STRIP "${mariadb_MACOS_PREFIX}" mariadb_MACOS_PREFIX)
set(CMAKE_PREFIX_PATH "${mariadb_MACOS_PREFIX};${CMAKE_PREFIX_PATH}")
pkg_check_modules(mariadbclient_PKGCONF QUIET "lib${mariadbclient_LIBNAME}")
endif()

if (NOT mariadbclient_PKGCONF_FOUND)
message(FATAL_ERROR "pkg_config cannot find mariadb")
endif ()

# Set include directory
find_path(MariaDBClient_INCLUDE_DIR mysql.h
HINTS ${mariadbclient_PKGCONF_INCLUDEDIR}
Expand Down

0 comments on commit 6f8306c

Please sign in to comment.