From e640cc092db2d7bc78774002c19cd5d82f951127 Mon Sep 17 00:00:00 2001 From: Hazimi Md Nazri Date: Fri, 19 Jan 2024 22:11:53 +0800 Subject: [PATCH] Add support for gentoo linux, dev-db/mariadb contains mysql (#1914) --- cmake_modules/FindMySQL.cmake | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/cmake_modules/FindMySQL.cmake b/cmake_modules/FindMySQL.cmake index 2494f594..c94e6366 100644 --- a/cmake_modules/FindMySQL.cmake +++ b/cmake_modules/FindMySQL.cmake @@ -27,6 +27,26 @@ # ############################################################################## # -------------- FIND MYSQL_INCLUDE_DIRS ------------------ +find_path(MARIADB_INCLUDE_DIRS + NAMES mysql.h + PATH_SUFFIXES mariadb + PATHS /usr/include/mysql + /usr/local/include/mysql + /usr/include/mariadb + /usr/local/include/mariadb + /opt/mysql/mysql/include + /opt/mysql/mysql/include/mysql + /opt/mysql/include + /opt/local/include/mysql5 + /usr/local/mysql/include + /usr/local/mysql/include/mysql + /usr/local/mariadb/include + /usr/local/mariadb/include/mariadb + /opt/rh/rh-mariadb105/root/usr/include + /opt/rh/rh-mariadb105/root/usr/include/mysql + $ENV{ProgramFiles}/MySQL/*/include + $ENV{SystemDrive}/MySQL/*/include) + find_path(MYSQL_INCLUDE_DIRS NAMES mysql.h PATH_SUFFIXES mysql @@ -47,7 +67,9 @@ find_path(MYSQL_INCLUDE_DIRS $ENV{ProgramFiles}/MySQL/*/include $ENV{SystemDrive}/MySQL/*/include) -if(EXISTS "${MYSQL_INCLUDE_DIRS}/mysql.h") +if(EXISTS "${MARIADB_INCLUDE_DIRS}/mysql.h") + set(MYSQL_INCLUDE_DIRS ${MARIADB_INCLUDE_DIRS}) +elseif(EXISTS "${MYSQL_INCLUDE_DIRS}/mysql.h") elseif(EXISTS "${MYSQL_INCLUDE_DIRS}/mysql/mysql.h") set(MYSQL_INCLUDE_DIRS ${MYSQL_INCLUDE_DIRS}/mysql) @@ -77,7 +99,7 @@ if(WIN32) $ENV{SystemDrive}/MySQL/*/lib/${libsuffixDist}) else(WIN32) find_library(MYSQL_LIBRARIES - NAMES mysqlclient_r mariadbclient + NAMES mysqlclient_r mariadbclient mariadb PATHS /usr/lib/mysql /usr/lib/mariadb /usr/local/lib/mysql