From 3b9c00c6ec7decfcd32a9d821265ff3ae504cb27 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Tue, 19 Dec 2017 14:04:04 +0100 Subject: [PATCH 1/3] FindMySQL: Allow other implementations Like mariadbclient. So the user can specify the same via -D --- third-party/cmake/FindMySQL.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/third-party/cmake/FindMySQL.cmake b/third-party/cmake/FindMySQL.cmake index 60c23afd5..14cf78514 100644 --- a/third-party/cmake/FindMySQL.cmake +++ b/third-party/cmake/FindMySQL.cmake @@ -74,11 +74,13 @@ IF (WIN32) $ENV{ProgramFiles}/MySQL/*/lib/${libsuffixDist} $ENV{SystemDrive}/MySQL/*/lib/${libsuffixDist}) ELSE (WIN32) - SET(MYSQL_CLIENT_LIBS mysqlclient) + IF (NOT MYSQL_CLIENT_LIBS) + SET(MYSQL_CLIENT_LIBS mysqlclient) + ENDIF (NOT MYSQL_CLIENT_LIBS) FILE(GLOB _macports_lib_dirs /opt/local/lib/mysql*/mysql) - FIND_LIBRARY(MYSQL_LIB NAMES mysqlclient + FIND_LIBRARY(MYSQL_LIB NAMES ${MYSQL_CLIENT_LIBS} PATHS $ENV{MYSQL_DIR}/libmysql_r/.libs $ENV{MYSQL_DIR}/lib From f4c5c8d78a041e795d7e15ae0c9166d4d6e1c597 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Wed, 3 Jan 2018 13:12:39 +0100 Subject: [PATCH 2/3] INSTALL: Document MySQL and PostgreSQL variables --- INSTALL.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index cb34dfd03..2a9826034 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -153,8 +153,6 @@ In addition to `CMAKE_INSTALL_PREFIX` here are most of the supported Icinga-spec Defaults to `OFF`. **Features:** -- `ICINGA2_WITH_MYSQL`: Determines whether the MySQL IDO module is built; defaults to `ON` -- `ICINGA2_WITH_PGSQL`: Determines whether the PostgreSQL IDO module is built; defaults to `ON` - `ICINGA2_WITH_CHECKER`: Determines whether the checker module is built; defaults to `ON` - `ICINGA2_WITH_COMPAT`: Determines whether the compat module is built; defaults to `ON` - `ICINGA2_WITH_DEMO`: Determines whether the demo module is built; defaults to `OFF` @@ -165,6 +163,27 @@ In addition to `CMAKE_INSTALL_PREFIX` here are most of the supported Icinga-spec - `ICINGA2_WITH_STUDIO`: Determines whether the Icinga Studio application is built; defaults to `OFF` - `ICINGA2_WITH_TESTS`: Determines whether the unit tests are built; defaults to `ON` +**MySQL or MariaDB:** + +The following settings can be tuned for the MySQL / MariaDB IDO feature. + +- `ICINGA2_WITH_MYSQL`: Determines whether the MySQL IDO module is built; defaults to `ON` +- `MYSQL_CLIENT_LIBS`: Client implementation used (mysqlclient / mariadbclient); defaults searches for `mysqlclient` +- `MYSQL_INCLUDE_DIR`: Directory containing include files for the mysqlclient; default empty - + checking multiple paths like `/usr/include/mysql` + +See [FindMySQL.cmake](third-party/cmake/FindMySQL.cmake) for the implementation. + +**PostgreSQL:** + +The following settings can be tuned for the PostgreSQL IDO feature. + +- `ICINGA2_WITH_PGSQL`: Determines whether the PostgreSQL IDO module is built; defaults to `ON` +- `PostgreSQL_INCLUDE_DIR`: Top-level directory containing the PostgreSQL include directories +- `PostgreSQL_LIBRARY_DIR`: Top-level directory containing the PostgreSQL libraries + +See [FindMySQL.cmake](third-party/cmake/FindPostgreSQL.cmake) for the implementation. + **Version detection:** CMake determines the Icinga 2 version number using `git describe` if the From fb0cc79de6c9dbbf56afd66d2d7ba0596a424cf9 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Thu, 4 Jan 2018 17:32:54 +0100 Subject: [PATCH 3/3] FindMySQL: Search for mariadbclient by default This would look for both names and use the first found. --- INSTALL.md | 2 +- third-party/cmake/FindMySQL.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 2a9826034..79e3a7aa8 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -168,7 +168,7 @@ In addition to `CMAKE_INSTALL_PREFIX` here are most of the supported Icinga-spec The following settings can be tuned for the MySQL / MariaDB IDO feature. - `ICINGA2_WITH_MYSQL`: Determines whether the MySQL IDO module is built; defaults to `ON` -- `MYSQL_CLIENT_LIBS`: Client implementation used (mysqlclient / mariadbclient); defaults searches for `mysqlclient` +- `MYSQL_CLIENT_LIBS`: Client implementation used (mysqlclient / mariadbclient); defaults searches for `mysqlclient` and `mariadbclient` - `MYSQL_INCLUDE_DIR`: Directory containing include files for the mysqlclient; default empty - checking multiple paths like `/usr/include/mysql` diff --git a/third-party/cmake/FindMySQL.cmake b/third-party/cmake/FindMySQL.cmake index 14cf78514..77465d027 100644 --- a/third-party/cmake/FindMySQL.cmake +++ b/third-party/cmake/FindMySQL.cmake @@ -75,7 +75,7 @@ IF (WIN32) $ENV{SystemDrive}/MySQL/*/lib/${libsuffixDist}) ELSE (WIN32) IF (NOT MYSQL_CLIENT_LIBS) - SET(MYSQL_CLIENT_LIBS mysqlclient) + SET(MYSQL_CLIENT_LIBS mysqlclient mariadbclient) ENDIF (NOT MYSQL_CLIENT_LIBS) FILE(GLOB _macports_lib_dirs /opt/local/lib/mysql*/mysql)