diff --git a/CMakeLists.txt b/CMakeLists.txt index f788202ea..0156fc6ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,7 @@ check_deps() check_dirs() find_package(Valgrind) find_package(MySQLClient) +find_package(MySQLConfig) set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/modules) diff --git a/FindMySQLConfig.cmake b/FindMySQLConfig.cmake new file mode 100644 index 000000000..a20e6dc47 --- /dev/null +++ b/FindMySQLConfig.cmake @@ -0,0 +1,13 @@ +# This CMake file tries to find the the MySQL configuration tool +# The following variables are set: +# MYSQLCONFIG_FOUND - System has MySQL and the tool was found +# MYSQLCONFIG_EXECUTABLE - The MySQL configuration tool executable +find_program(MYSQLCONFIG_EXECUTABLE mysql_config) +if(MYSQLCONFIG_EXECUTABLE MATCHES "MYSQLCONFIG_EXECUTABLE-NOTFOUND") + message(FATAL_ERROR "Cannot find mysql_config.") + set(MYSQLCONFIG_FOUND FALSE CACHE INTERNAL "") + unset(MYSQLCONFIG_EXECUTABLE) +else() + message(STATUS "mysql_config found: ${MYSQLCONFIG_EXECUTABLE}") + set(MYSQLCONFIG_FOUND TRUE CACHE INTERNAL "") +endif() diff --git a/debian/rules b/debian/rules index fd6b52622..5acfaf7aa 100755 --- a/debian/rules +++ b/debian/rules @@ -3,7 +3,7 @@ $(MAKE) ROOT_PATH=$(shell pwd) HOME="" clean $(MAKE) ROOT_PATH=$(shell pwd) HOME="" depend $(MAKE) ROOT_PATH=$(shell pwd) HOME="" - $(MAKE) DEST="$(shell pwd)/binaries" ROOT_PATH=$(shell pwd) HOME="" ERRMSG="/usr/share/mysql/english" EMBEDDED_LIB="/usr/lib/x86_64-linux-gnu/" install + $(MAKE) DEST="$(shell pwd)/binaries" ROOT_PATH=$(shell pwd) HOME="" ERRMSG="/usr/share/mysql/english" EMBEDDED_LIB="$(mysql_config --variable=pkglibdir)" install dh $@ override_dh_usrlocal: override_dh_auto_clean: