-1

I'm using XAMPP to install and run MySQL, and when I run me@host:/path/to/mysql-connector-cpp> cmake ., it throws

-- BOOST_INCLUDE_DIRS=/usr/local/include
-- ENV{MYSQL_DIR} = 
CMake Error at FindMySQL.cm:202 (MESSAGE):
  mysql_config wasn't found, -DMYSQL_CONFIG_EXECUTABLE=...
Call Stack (most recent call first):
  CMakeLists.txt:166 (INCLUDE)


CMake Error at FindMySQL.cm:204 (MESSAGE):
  Cannot find MySQL.  Include dir: MYSQL_INCLUDE_DIR-NOTFOUND library dir:
  cxxflags:
Call Stack (most recent call first):
  CMakeLists.txt:166 (INCLUDE)


-- Configuring incomplete, errors occurred!

I'm using XAMPP so I'm sure cmake is looking for MySQL in the wrong directory. How do I tell it where it's located?

1 Answers1

0

You could point it to proper mysql-config executable:

cmake -D MYSQL_CONFIG_EXECUTABLE=/path/to/mysql-config .

Or you can just define needed vars:

cmake -D MYSQL_INCLUDE_DIR=... -D MYSQL_LIBRARY_DIR .
arrowd
  • 33,231
  • 8
  • 79
  • 110
  • In my case under Windows I had to use this command line: cmake -G "Visual Studio 12" -DBOOST_ROOT:STRING=d:\Listati\Siti\boost_1_55_0 -DMYSQL_INCLUDE_DIR:STRING=d:\xampp\mysql\include -DMYSQL_LIB_DIR:STRING=d:\xampp\mysql\lib – Andrea Giovacchini May 13 '14 at 12:44