diff options
author | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-01-24 16:23:16 +0100 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-01-24 16:23:16 +0100 |
commit | c514d75ebb0651dcc65ca9e09cf8458dc904f242 (patch) | |
tree | c43eba4b5b19fd0edbb74db874eadf3a2a91f9c7 /CMakeLists.txt | |
parent | df9f68e9730d5d1f00ad82536c27352b9915c018 (diff) | |
download | mariadb-git-c514d75ebb0651dcc65ca9e09cf8458dc904f242.tar.gz |
Handle different installation layouts.
using cmake option INSTALL_LAYOUT=STANDALONE would produce the layout as in
tar.gz or zip packages.
INSTALL_LAYOUT=UNIX will produce unixish install layout (with mysqld being in sbin subdirectory , libs in lib/mysql etc). This layout is used for RPM packages.
Subtle differences in both packages unfortunately lead to the need to recompile MySQL to use with other package type - as otherwise for example default plugins or data directories would be wrong set.
There are numerous other variables that allow fine-tuning packaging layout. (INSTALL_BINDIR, INSTALL_LIBDIR , INSTALL_PLUGINDIR etc).
This options are different from autotools as they do not expect full paths to directories, but only subdirectory of CMAKE_INSTALL_PREFIX.
There are 2 special options that expect full directory paths
- MYSQL_DATADIR that defines default MYSQL data directory (autotools equivalent
is --localstatedir)
- SYSCONFDIR can be added to search my.cnf search path (autotools equivalent is --sysconfdir)
Diffstat (limited to 'CMakeLists.txt')
-rwxr-xr-x | CMakeLists.txt | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 752e66ae746..668675d4444 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,6 +82,7 @@ INCLUDE(libutils) INCLUDE(dtrace) INCLUDE(plugin) INCLUDE(install_macros) +INCLUDE(install_layout) INCLUDE(mysql_add_executable) # Handle options @@ -165,12 +166,17 @@ IF(WIN32) SET(SHAREDIR share) ELSE() SET(DEFAULT_MYSQL_HOME ${CMAKE_INSTALL_PREFIX}) - SET(SHAREDIR ${DEFAULT_MYSQL_HOME}/share) + SET(SHAREDIR ${DEFAULT_MYSQL_HOME}/${INSTALL_MYSQLSHAREDIR}) ENDIF() SET(DEFAULT_BASEDIR "${DEFAULT_MYSQL_HOME}") -SET(MYSQL_DATADIR "${DEFAULT_MYSQL_HOME}/data") +SET(MYSQL_DATADIR "${DEFAULT_MYSQL_HOME}/${INSTALL_MYSQLDATADIR}" CACHE PATH + "default MySQL data directory") SET(DEFAULT_CHARSET_HOME "${DEFAULT_MYSQL_HOME}") +SET(PLUGINDIR "${DEFAULT_MYSQL_HOME}/${INSTALL_PLUGINDIR}") +IF(SYSCONFDIR) + SET(DEFAULT_SYSCONFDIR "${SYSCONFDIR}") +ENDIF() # Optionally read user configuration, generated by configure.js. @@ -255,11 +261,11 @@ ELSE() SET(CPACK_GENERATOR "TGZ") ENDIF() INCLUDE(CPack) -INSTALL(FILES COPYING EXCEPTIONS-CLIENT README DESTINATION .) +INSTALL(FILES COPYING EXCEPTIONS-CLIENT README DESTINATION ${INSTALL_DOCREADMEDIR}) IF(UNIX) - INSTALL(FILES Docs/INSTALL-BINARY DESTINATION .) + INSTALL(FILES Docs/INSTALL-BINARY DESTINATION ${INSTALL_DOCREADMEDIR}) ENDIF() # MYSQL_DOCS_LOCATON is used in "make dist", points to the documentation directory SET(MYSQL_DOCS_LOCATION "" CACHE PATH "Location from where documentation is copied") MARK_AS_ADVANCED(MYSQL_DOCS_LOCATION) -INSTALL(DIRECTORY Docs DESTINATION .) +INSTALL(DIRECTORY Docs/ DESTINATION ${INSTALL_DOCDIR}) |