Documentation Home
MySQL Internals Manual Fine-Tuning Installation Paths

If you come from an Autotools background, you are familiar with options such as --bindir, --libdir, and --sbindir that, when passed to the configure script, enable fine tuning the installation layout. A similar functionality is available with CMake:

  • CMAKE_INSTALL_PREFIX: Specifies the root directory of the installation (same as Autotools --prefix).

  • INSTALL_BINDIR, INSTALL_LIBDIR, INSTALL_SBINDIR: These correspond to the Autotools --bindir, --libdir, and --sbindir options. A subtle difference is that INSTALL_XXXDIR values should be paths relative to CMAKE_INSTALL_PREFIX. For example, INSTALL_BINDIR should be bin, not /usr/bin.

  • The INSTALL_LAYOUT option enables choosing one of several predefined installation layouts:

    • STANDALONE layout is the same as in .tar.gz/.zip packages. This is the default.

    • RPM layout is similar to RPM packages. For example, mysqld is in the sbin subdirectory.

    • SVR4 is Solaris package layout.

    • DEB layout is as in DEB packages. (experimental)

Here is an example how to modify STANDLONE layout slightly and install libraries into the lib64 subdirectory instead of the default lib: