Documentation Home
MySQL Connector/C++ Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 0.6Mb
PDF (A4) - 0.6Mb
HTML Download (TGZ) - 432.6Kb
HTML Download (Zip) - 455.7Kb


MySQL Connector/C++ Developer Guide  /  Installing Connector/C++ from Source  /  Connector/C++ Source-Configuration Options

4.7 Connector/C++ Source-Configuration Options

Connector/C++ recognizes the CMake options described in this section.

Table 4.1 Connector/C++ Source-Configuration Option Reference

FormatsDescriptionDefaultIntroduced
BOOST_ROOTThe Boost source directory  
CMAKE_BUILD_TYPEType of build to produceRelWithDebInfo 
CMAKE_ENABLE_C++11Whether to enable C++11 supportOFF1.1.6
CMAKE_INSTALL_PREFIXInstallation base directory/usr/local 
MYSQLCLIENT_NO_THREADSWhether to link against single-threaded MySQL client libraryOFF 
MYSQLCLIENT_STATIC_LINKINGWhether to statically link to the MySQL client libraryOFF 
MYSQLCPPCONN_GCOV_ENABLEWhether to enable gcov supportOFF 
MYSQLCPPCON_TRACE_ENABLEWhether to enable tracing functionalityOFF 
MYSQL_CFLAGSC compiler flags  
MYSQL_CONFIG_EXECUTABLEPath to the mysql_config program${MYSQL_DIR}/bin/mysql_config 
MYSQL_CXXFLAGSC++ compiler flags  
MYSQL_CXX_LINKAGEWhether MySQL client library needs C++ linkingON 
MYSQL_DIRMySQL Server or Connector/C installation directory  
MYSQL_EXTRA_LIBRARIESExtra link libraries  
MYSQL_INCLUDE_DIRThe MySQL header file directory${MYSQL_DIR}/include 
MYSQL_LIB_DIRThe MySQL client library directory${MYSQL_DIR}/lib 
MYSQL_LINK_FLAGSExtra link flags  
USE_SERVER_CXXFLAGSUse MySQL Server CXXFLAGS value rather than system defaultOFF1.1.7

  • -DBOOST_ROOT=dir_name

    The directory where the Boost sources are installed.

  • -DCMAKE_BUILD_TYPE=type

    The type of build to produce:

    • RelWithDebInfo: Enable optimizations and generate debugging information. This is the default Connector/C++ build type.

    • Debug: Disable optimizations and generate debugging information.

  • -DCMAKE_ENABLE_C++11=bool

    Whether to enable C++11 support. The default is OFF.

    This option was added in Connector/C++ 1.1.6.

  • -DCMAKE_INSTALL_PREFIX=dir_name

    The installation base directory.

  • -DMYSQLCLIENT_NO_THREADS=bool

    Whether to link against a single-threaded libmysqlclient MySQL client library. In MySQL 5.5 and higher, the value of this option makes no difference because libmysqlclient is always multi-threaded.

  • -DMYSQLCLIENT_STATIC_LINKING=bool

    Whether to statically link to the MySQL client library. The default is OFF (use dynamic linking to the client library). For more information, see Section 4.6, “Dynamically Linking Connector/C++ Against the MySQL Client Library”.

  • -DMYSQLCPPCONN_GCOV_ENABLE=bool

    Whether to enable gcov support.

  • -DMYSQLCPPCON_TRACE_ENABLE=VALUE_TYPE

    Whether to enable tracing functionality. For information about tracing, see Chapter 9, Connector/C++ Debug Tracing.

  • -DMYSQL_CFLAGS=flags

    C compiler flags.

  • -DMYSQL_CONFIG_EXECUTABLE=file_name

    The path to the mysql_config program.

    On non-Windows systems, CMake checks to see whether the MYSQL_CONFIG_EXECUTABLE CMake option is set. If not, CMake tries to locate mysql_config in the default locations.

  • -DMYSQL_CXXFLAGS=flags

    C++ compiler flags.

  • -DMYSQL_CXX_LINKAGE=bool

    Whether the MySQL client library needs C++ linking.

  • -DMYSQL_DIR=dir_name

    The directory where MySQL Server or Connector/C is installed.

  • -DMYSQL_EXTRA_LIBRARIES=flags

    Any needed additional link libraries.

  • -DMYSQL_INCLUDE_DIR=dir_name

    The directory where the MySQL header files are installed.

  • -DMYSQL_LIB_DIR=dir_name

    The directory where the MySQL client library is installed.

  • -DMYSQL_LINK_FLAGS=flags

    Any needed additional link flags.

  • -DUSE_SERVER_CXXFLAGS=bool

    Use MySQL Server CXXFLAGS values rather than the system default value.

    This option was added in Connector/C++ 1.1.7.


User Comments
Sign Up Login You must be logged in to post a comment.