Mysql Cmake

CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice. The suite of CMake tools were created by Kitware in response to the need for a powerful, cross-platform build environment for open-source projects such as ITK and VTK.

CMake is part of Kitware’s collection of commercially supported open-source platforms for software development.

Contact Us

Have a question about a CMake project? We can help

Training Courses

Book

Just a bit of context: I'm maintaining a library of MySQL UDF functions that I didn't write and I'm interested into using CMake instead of Autotools. While reading the doc, I stumbled across the MYSQLADDPLUGIN Cmake command that seems to take care of much of the burden. Build MySQL Server with CMake. If you start from a source RPM, use the following command to make a binary RPM that you can install. If you do not have rpmbuild, use rpm instead. Shell rpmbuild -rebuild -clean MySQL-VERSION.src.rpm The result is one or more binary RPM packages that you install as indicated in Installing MySQL on Linux. The CMake program provides a great deal of control over how you configure a MySQL source distribution. Typically, you do this using options on the CMake command line. For information about options supported by CMake, run either of these commands in the top-level source directory.

Get the latest edition of the Mastering CMake book

Netflix

“…CMake, CTest, and CDash have proven to be invaluable tools for us to build multiplatform code, track changes, run tests, and improve code quality by performing code coverage and memory leak analysis.”

Inria

“I am thankful for CMake’s shadow builds feature. For a project like SOFA, which has many optional features and possible option combinations, being able to quickly test a modification on several typical setups on my machine before pushing a significant change to the repository is a very valuable security. This is especially true for a complex project like ours.”

The HDF Group

Mysql Cmake Boost

“CMake, CTest, and CDash were the tools that we desperately needed. With the help of our user community, we added the CMake build system for all HDF products. We rely on CMake for HDF software being successfully built and tested on platforms that range from supercomputers to Windows desktops and tablets.”

Cmake_build_type

ReactOS

“…in early 2010 a decision was made to look for a third party solution instead of continuing to expend time and effort maintaining RBuild. CMake was an early favorite and while the transition was not without its bumps, it has allowed the project to not only increase the number of compilers that could be used to build ReactOS, it also set the stage for significantly decreasing build times, making development faster and easier.”

KDE

“Our working relationship aside, CMake has greatly improved the process of building KDE. Projects using CMake take less time to get started, since there is less time spent fighting with the build system. One KDE developer says, “CMake doesn’t make you want to shoot yourself with a nailgun when building your project anymore.”

Second Life

“A great technology choice that our community helped us make was moving to CMake, a cross-platform build tool, which makes it much simpler to maintain makefiles for many different platforms.”

Mysql Cmake Not Found

  • Allegro library
  • Armadillo
  • Avidemux
  • awesome
  • BCI2000
  • Blender
  • BRL-CAD
  • Bullet Physics Engine
  • CGAL
  • Chipmunk physics engine
  • CLion
  • Compiz
  • Conky
  • cURL
  • Deal.II
  • Doomsday Engine
  • Dust Racing 2D
  • Drishti
  • Ettercap
  • Falcon (programming language)
  • FlightGear Flight Simulator
  • GDCM
  • Geant4
  • Gmsh
  • GNU Radio
  • GROMACS
  • Hiawatha (web server)
  • Hypertable
  • Hugin
  • iCub robot and YARP
  • IGSTK
  • ITK
  • KDE SC 4
  • KiCad
  • libpng
  • LAPACK
  • LLVM and Clang
  • LMMS
  • Mir
  • MiKTeX
  • MLPACK
  • MuseScore
  • MySQL and MariaDB
  • OGRE
  • OpenCV
  • OpenCog
  • OpenCPN
  • OpenSceneGraph
  • OpenSync
  • Orthanc
  • Point Cloud Library
  • Poppler
  • PvPGN
  • QGIS
  • Qt
  • Raw Therapee
  • ReactOS
  • ROOT
  • ROS
  • Ryzom
  • Scribus
  • SDL
  • Second Life
  • SFML
  • Spring RTS
  • SuperTux
  • Synergy
  • Slicer
  • Stellarium
  • Trilinos
  • Vortexje
  • VTK and ParaView
  • VXL
  • zlib
  • PCSX2
  • Zdoom
  • ZeroMQ

CMake 3.20.2 available for download

CMake 3.20.2 is now available for download …

CMake 3.20.1 available for download

CMake 3.20.1 is now available for download …

CMake 3.19.8 available for download

CMake 3.19.8 is now available for download …

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

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

FormatsDescriptionDefaultIntroduced
BUILD_STATICWhether to build a static librartyOFF
BUNDLE_DEPENDENCIESWhether to bundle external dependency libraries with the connectorOFF
CMAKE_BUILD_TYPEType of build to produceDebug
CMAKE_INSTALL_DOCDIRDocumentation installation directory8.0.14
CMAKE_INSTALL_INCLUDEDIRHeader file installation directory8.0.14
CMAKE_INSTALL_LIBDIRLibrary installation directory8.0.14
CMAKE_INSTALL_PREFIXInstallation base directory/usr/local
MAINTAINER_MODEFor internal use onlyOFF8.0.12
MYSQLCLIENT_STATIC_BINDINGWhether to link to the shared MySQL client libraryON8.0.16
MYSQLCLIENT_STATIC_LINKINGWhether to statically link to the MySQL client libraryON8.0.16
MYSQL_CONFIG_EXECUTABLEPath to the mysql_config program${MYSQL_DIR}/bin/mysql_config
MYSQL_DIRMySQL Server installation directory
STATIC_MSVCRTUse the static runtime library
WITH_BOOSTThe Boost source directory
WITH_DOCWhether to generate Doxygen documentationOFF
WITH_JDBCWhether to build legacy JDBC libraryOFF8.0.7
WITH_SSLType of SSL supportsystem8.0.7

Mysql Cmake Option

Code

Mysql Cmake_build_type

  • -DBUILD_STATIC=bool

    By default, dynamic (shared) libraries are built. If this option is enabled, static libraries are built instead.

  • -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_INSTALL_DOCDIR=dir_name

    The documentation installation directory, relative to CMAKE_INSTALL_PREFIX. If not specified, the default is to install in CMAKE_INSTALL_PREFIX.

    This option requires that WITH_DOC be enabled.

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

  • -DCMAKE_INSTALL_INCLUDEDIR=dir_name

    The header file installation directory, relative to CMAKE_INSTALL_PREFIX. If not specified, the default is include.

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

  • -DCMAKE_INSTALL_LIBDIR=dir_name

    The library installation directory, relative to CMAKE_INSTALL_PREFIX. If not specified, the default is lib64 or lib.

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

  • -DCMAKE_INSTALL_PREFIX=dir_name

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

  • -DMAINTAINER_MODE=bool

    This is an internal option used for creating Connector/C++ distribution packages. It was added in Connector/C++ 8.0.12.

  • -DMYSQLCLIENT_STATIC_BINDING=bool

    Whether to link to the shared MySQL client library. This option is used only if MYSQLCLIENT_STATIC_LINKING is disabled to enable dynamic linking of 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.

    This option applies only if you are building the legacy JDBC connector (that is, only if WITH_JDBC is enabled). It was added in Connector/C++ 8.0.16.

  • -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.

    This option applies only if you are building the legacy JDBC connector (that is, only if WITH_JDBC is enabled). It was added in Connector/C++ 8.0.16.

  • -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.

    This option applies only if you are building the legacy JDBC connector (that is, only if WITH_JDBC is enabled).

  • -DMYSQL_DIR=dir_name

    The directory where MySQL is installed.

    This option applies only if you are building the legacy JDBC connector (that is, only if WITH_JDBC is enabled).

  • -DSTATIC_MSVCRT=bool

    (Windows only) Use the static runtime library (the /MT* compiler option). This option might be necessary if code that uses Connector/C++ also uses the static runtime library.

  • -DWITH_BOOST=dir_name

    The directory where the Boost sources are installed.

  • -DWITH_DOC=bool

    Whether to enable generating the Doxygen documentation. As of Connector/C++ 8.0.16, enabling this option also causes the Doxygen documentation to be built by the all target.

  • -DWITH_JDBC=bool

    Whether to build the legacy JDBC connector. This option is disabled by default. If it is enabled, Connector/C++ 8.0 applications can use the legacy JDBC API, just like Connector/C++ 1.1 applications.

  • -DWITH_SSL={ssl_typepath_name}

    This option specifies which SSL library to use when compiling Connector/C++. The option value indicates the type of SSL support to include or the path name to the SSL installation to use:

    • ssl_type can be one of the following values:

      • system: Use the system OpenSSL library.

        When running an application that is linked to the connector dynamic 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 connector dynamic 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-rpath option).

        For Windows, an application that is linked to the connector shared library 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 PATH environment variable

        If the application is linked to the connector static library, it remains true that the required OpenSSL libraries must be found in one of the preceding locations.

    • path_name is the path name to the SSL installation to use. It should be the path to the installed OpenSSL library, and must point to a directory containing a lib subdirectory with OpenSSL libraries that are already built.

      Specifying a path name for the OpenSSL installation can be preferable to using the ssl_type value of system because it can prevent CMake from detecting and using an older or incorrect OpenSSL version installed on the system.