Documentation Home
MySQL Connector/C++ 1.1 Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 285.1Kb
PDF (A4) - 286.0Kb


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

4.6 Connector/C++ Source-Configuration Options

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

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

Formats Description Default Introduced
BOOST_ROOT The Boost source directory
BUNDLE_DEPENDENCIES Whether to bundle external dependency libraries with the connector OFF 1.1.11
CMAKE_BUILD_TYPE Type of build to produce Debug
CMAKE_ENABLE_C++11 Whether to enable C++11 support OFF 1.1.6
CMAKE_INSTALL_PREFIX Installation base directory /usr/local
MYSQLCLIENT_NO_THREADS Whether to link against single-threaded MySQL client library OFF
MYSQLCLIENT_STATIC_BINDING Whether to link to the shared MySQL client library ON
MYSQLCLIENT_STATIC_LINKING Whether to statically link to the MySQL client library ON
MYSQLCPPCONN_GCOV_ENABLE Whether to enable gcov support OFF
MYSQLCPPCONN_TRACE_ENABLE Whether to enable tracing functionality OFF
MYSQL_CFLAGS C compiler flags
MYSQL_CONFIG_EXECUTABLE Path to the mysql_config program ${MYSQL_DIR}/bin/mysql_config
MYSQL_CXXFLAGS C++ compiler flags
MYSQL_CXX_LINKAGE Whether MySQL client library needs C++ linking ON
MYSQL_DIR MySQL Server installation directory
MYSQL_EXTRA_LIBRARIES Extra link libraries
MYSQL_INCLUDE_DIR The MySQL header file directory ${MYSQL_DIR}/include
MYSQL_LIB_DIR The MySQL client library directory ${MYSQL_DIR}/lib
MYSQL_LINK_FLAGS Extra link flags
USE_SERVER_CXXFLAGS Use MySQL Server CXXFLAGS value rather than system default OFF 1.1.7

  • -DBOOST_ROOT=dir_name

    The directory where the Boost sources are installed.

  • -DBUNDLE_DEPENDENCIES=bool

    This is an internal option used for creating Connector/C++ distribution packages.

  • -DCMAKE_BUILD_TYPE=type

    The type of build to produce:

    • Debug: Disable optimizations and generate debugging information. This is the default.

    • Release: Enable optimizations.

    • RelWithDebInfo: Enable optimizations and generate debugging information.

  • -DCMAKE_ENABLE_C++11=bool

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

  • -DCMAKE_INSTALL_PREFIX=dir_name

    The installation base directory (where to install Connector/C++).

  • -DMYSQLCLIENT_NO_THREADS=bool

    Whether to link against a single-threaded libmysqlclient MySQL client library.

    This option is obsolete; libmysqlclient is always multithreaded.

  • -DMYSQLCLIENT_STATIC_BINDING=bool

    Whether to link to the shared MySQL client library. This option is used only if MYSQLCLIENT_STATIC_LINKING is disabled. disabled to enable dynamic linking to the MySQL client library. In that case, if MYSQLCLIENT_STATIC_BINDING is enabled (the default), Connector/C++ is linked to the shared MySQL client library. Otherwise, the shared MySQL client library is loaded and mapped at runtime. For more information, see Section 4.5, “Dynamically Linking Connector/C++ Against the MySQL Client Library”.

  • -DMYSQLCLIENT_STATIC_LINKING=bool

    Whether to link statically to the MySQL client library. The default is ON (use static linking to the client library). Disabling this option enables dynamic linking to the client library. For more information, see Section 4.5, “Dynamically Linking Connector/C++ Against the MySQL Client Library”.

  • -DMYSQLCPPCONN_GCOV_ENABLE=bool

    Whether to enable gcov support.

  • -DMYSQLCPPCONN_TRACE_ENABLE=VALUE_TYPE

    Whether to enable tracing functionality. For information about tracing, see Chapter 8, 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 MYSQL_CONFIG_EXECUTABLE 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 is installed.

  • -DMYSQL_EXTRA_LIBRARIES=flags

    Any required 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 required additional link flags.

  • -DUSE_SERVER_CXXFLAGS=bool

    Use MySQL CXXFLAGS values rather than the system default value.