Connector/C++ recognizes the
CMake options described
in this section.
Table 4.1 Connector/C++ Source-Configuration Option Reference
||The Boost source directory|
||Type of build to produce||
||Whether to enable C++11 support||
||Installation base directory||
||Whether to link against single-threaded MySQL client library||
||Whether to statically link to the MySQL client library||
||Whether to enable gcov support||
||Whether to enable tracing functionality||
||C compiler flags|
||Path to the mysql_config program||
||C++ compiler flags|
||Whether MySQL client library needs C++ linking||
||MySQL Server or Connector/C installation directory|
||Extra link libraries|
||The MySQL header file directory||
||The MySQL client library directory||
||Extra link flags|
||Use MySQL Server CXXFLAGS value rather than system default||
||Type of SSL support||
The directory where the Boost sources are installed.
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.
Whether to enable C++11 support. The default is
This option was added in Connector/C++ 1.1.6.
The installation base directory.
Whether to link against a single-threaded
libmysqlclientMySQL client library. In MySQL 5.5 and higher, the value of this option makes no difference because
libmysqlclientis always multi-threaded.
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.5, “Dynamically Linking Connector/C++ Against the MySQL Client Library”.
Whether to enable gcov support.
Whether to enable tracing functionality. For information about tracing, see Chapter 9, Connector/C++ Debug Tracing.
C compiler flags.
The path to the mysql_config program.
On non-Windows systems, CMake checks to see whether the
MYSQL_CONFIG_EXECUTABLECMake option is set. If not, CMake tries to locate
mysql_configin the default locations.
C++ compiler flags.
Whether the MySQL client library needs C++ linking.
The directory where MySQL Server or Connector/C is installed.
Any needed additional link libraries.
The directory where the MySQL header files are installed.
The directory where the MySQL client library is installed.
Any needed additional link flags.
Use MySQL Server
CXXFLAGSvalues rather than the system default value.
This option was added in Connector/C++ 1.1.7.
The type of SSL support to include or the path name to the OpenSSL installation to use.
ssl_typecan be one of the following values:
bundled: Use the SSL library bundled with the distribution. This is the default.
system: Use the system SSL library.
When running an application that is linked to the shared connector library, the OpenSSL libraries on which the connector depends should be correctly found if they are placed in the file system next to the connector library. The application should also work when the OpenSSL libraries are installed at the standard system-wide locations. This assumes that the version of OpenSSL is as expected by Connector/C++.
Compressed tar files or Zip archive distributions for for Windows, Linux, and macOS should contain the required OpenSSL libraries in the same location as the connector library.
Except for Windows, it should be possible to run an application linked to the shared connector library when the connector library and the OpenSSL libraries are placed in a nonstandard location, provided that these locations were stored as runtime paths when building the application (gcc
For Windows, an application that is linked to the shared connector can be run only if the connector library and the OpenSSL libraries are stored either:
In the Windows system folder
In the same folder as the application
In a folder listed in the
If the application is linked to the static connector library, it remains true that the required OpenSSL libraries must be found in one of the preceding locations.
path_nameis the path name to the OpenSSL installation to use. This can be preferable to using the
systembecause it can prevent CMake from detecting and using an older or incorrect OpenSSL version installed on the system.
This option was added in Connector/C++ 8.0.7.