Description:
CMake version: 3.5.2
(1) Downloaded mysql-connector-cpp-1.1.9.tar.gz from GitHub.
(2) Executed the command:
cmake . -DBOOST_ROOT=/usr/local/boost_1_64_0
The error:
-- Boost version: 1.64.0
-- BOOST_INCLUDE_DIRS=/usr/local/boost_1_64_0
-- You will link dynamically to the MySQL client library (set with -DMYSQLCLIENT_STATIC_LINKING=<bool>)
-- Searching for dynamic libraries with the base name(s) "mysqlclient_r mysqlclient"
-- mysql_config was found /usr/local/mysql/bin/mysql_config
CMake Error at FindMySQL.cmake:406 (message):
Could not find dynamic "mysqlclient_r mysqlclient" in MYSQL_LIB_DIR
"/usr/local/mysql/lib"
Call Stack (most recent call first):
FindMySQL.cmake:649 (_check_lib_search_error)
CMakeLists.txt:252 (INCLUDE)
-- Configuring incomplete, errors occurred!
See also "/home/yangwenbin/mysql-connector-cpp-1.1.9/CMakeFiles/CMakeOutput.log".
See also "/home/yangwenbin/mysql-connector-cpp-1.1.9/CMakeFiles/CMakeError.log".
How to repeat:
Executed the command:
(1) cd mysql-connector-cpp-1.1.9
(2) cmake . -DBOOST_ROOT=/usr/local/boost_1_64_0
Suggested fix:
Change the line 641 of mysql-connector-cpp-1.1.9/FindMySQL.cmake:
list(GET MYSQL_LIBRARIES 0 _search_libs)
to
list(GET MYSQL_LIBRARIES 0 ${_search_libs})