Commit 88a3e25f authored by Christophe Giboudeaux's avatar Christophe Giboudeaux
Browse files

Allow setting the MySQL scripts location

Some of the MySQL tools are simple shell scripts and may be installed in custom locations.
We now have a MYSQLD_SCRIPTS_PATH variable that can be set to point to the scripts dir.

CCBUG: 409224
parent 8917e6e3
Pipeline #55050 skipped
......@@ -177,12 +177,22 @@ find_program(MYSQLD_EXECUTABLE NAMES mysqld
DOC "The mysqld executable path. ONLY needed at runtime"
)
find_path(MYSQLD_SCRIPTS_PATH NAMES mysql_install_db
DOC "Path to the mysql or mariadb installation scripts (mysql_install_db, mysql_upgrade...)"
)
if(MYSQLD_EXECUTABLE)
message(STATUS "MySQL Server found: ${MYSQLD_EXECUTABLE}")
else()
message(STATUS "MySQL Server wasn't found. it is required to use the MySQL backend.")
endif()
if(MYSQLD_SCRIPTS_PATH)
message(STATUS "MySQL scripts location: ${MYSQLD_SCRIPTS_PATH}")
else()
message(STATUS "MySQL scripts location was not found. Use -DMYSQLD_SCRIPTS_PATH to point to the install location.")
endif()
find_path(POSTGRES_PATH NAMES pg_ctl
HINTS /usr/lib${LIB_SUFFIX}/postgresql/8.4/bin
/usr/lib${LIB_SUFFIX}/postgresql/9.0/bin
......
......@@ -172,6 +172,11 @@ add_library(libakonadiserver STATIC ${libakonadiserver_SRCS})
#endif()
set_target_properties(libakonadiserver PROPERTIES OUTPUT_NAME akonadiserver)
if(MYSQLD_SCRIPTS_PATH)
target_compile_definitions(libakonadiserver PRIVATE MYSQLD_SCRIPTS_PATH="${MYSQLD_SCRIPTS_PATH}")
endif()
target_link_libraries(libakonadiserver
akonadi_shared
KF5AkonadiPrivate
......
......@@ -48,6 +48,9 @@ QString DbConfigMysql::databaseName() const
static QString findExecutable(const QString &bin)
{
static const QStringList mysqldSearchPath = {
#ifdef MYSQLD_SCRIPTS_PATH
QStringLiteral(MYSQLD_SCRIPTS_PATH),
#endif
QStringLiteral("/usr/bin"),
QStringLiteral("/usr/sbin"),
QStringLiteral("/usr/local/sbin"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment