Documentation Home
MySQL Internals Manual
Download this Manual
EPUB - 1.2Mb


4.4.11 MySQL-Specific CMake Macros

  • MYSQL_ADD_EXECUTABLE

    Almost the same as ADD_EXECUTABLE. Supports optional DESTINATION option which indicates where to install the executable (if not specified, it goes to the INSTALL_BINDIR directory). For executables not intended to be installed, use ADD_EXECUTABLE instead. On Windows, signs the executable if the SIGNCODE option is set to TRUE.

    Example usage:

    MYSQL_ADD_EXECUTABLE(mysqld ${MYSQLD_SOURCE} \
    DESTINATION ${INSTALL_SBINDIR})
    
  • MYSQL_ADD_PLUGIN: Build MySQL Plugin

    MYSQL_ADD_PLUGIN(plugin_name source1...sourceN
    [STORAGE_ENGINE]
    [MANDATORY|DEFAULT]
    [STATIC_ONLY|MODULE_ONLY]
    [MODULE_OUTPUT_NAME module_name]
    [STATIC_OUTPUT_NAME static_name]
    [RECOMPILE_FOR_EMBEDDED]
    [LINK_LIBRARIES lib1...libN]
    [DEPENDENCIES target1...targetN])
    

    Parameters:

    • STORAGE_ENGINE

      Define for storage engines. Causes the shared library to be built with ha_ prefix.

    • MANDATORY

      Define for mandatory plugins (such as myisam). Causes the plugin to be always built.

    • DEFAULT

      Default plugin. Built unless WITHOUT_plugin_name option is defined. The InnoDB storage engine has this option starting with MySQL 5.5.5.

    • STATIC_ONLY

      Can be built only as a static library.

    • MODULE_ONLY

      Can be built only as a shared module.

    • MODULE_OUTPUT_NAME module_name

      Defines the plugin library name when it is built as a shared module.

    • STATIC_OUTPUT_NAME

      Defines the library name when it is built as a static library.

    • RECOMPILE_FOR_EMBEDDED

      Must be recompiled with the -DEMBEDDED_SERVER preprocessor flag for use with the embedded server. Few plugins need this, typically mandatory storage engines that depend on internal structures and on the EMBEDDED_SERVER flag.

    • LINK_LIBRARIES

      Libraries to link with plugin.

    • DEPENDENCIES

      Plugin dependencies.

    Example 1: Simple plugin that is only built as shared module

    MYSQL_ADD_PLUGIN(daemon_example daemon_example.cc MODULE_ONLY)
    

    Example 2: InnoDB plugin. Storage engine, redefines output name of shared library to be ha_innodb rather than ha_innobase, depends on the zlib library.

    MYSQL_ADD_PLUGIN(innobase ${INNOBASE_SOURCES}
      STORAGE_ENGINE MODULE_OUTPUT_NAME
      ha_innodb LINK_LIBRARIES ${ZLIB_LIBRARY})
    

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