summaryrefslogtreecommitdiff
path: root/cmake/install_layout.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/install_layout.cmake')
-rw-r--r--cmake/install_layout.cmake29
1 files changed, 25 insertions, 4 deletions
diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake
index ade6cdb747f..bbf29c2e46c 100644
--- a/cmake/install_layout.cmake
+++ b/cmake/install_layout.cmake
@@ -26,7 +26,7 @@
# Build as per default RPM layout, with prefix=/usr
#
# DEB
-# Build as per STANDALONE, prefix=/opt/mysql-$major.$minor
+# Build as per STANDALONE, prefix=/opt/mysql/server-$major.$minor
#
# SVR4
# Solaris package layout suitable for pkg* tools, prefix=/opt/mysql/mysql
@@ -59,19 +59,22 @@
# - INSTALL_SUPPORTFILESDIR (various extra support files)
#
# - INSTALL_MYSQLDATADIR (data directory)
+#
+# When changing this page, _please_ do not forget to update public Wiki
+# http://forge.mysql.com/wiki/CMake#Fine-tuning_installation_paths
IF(NOT INSTALL_LAYOUT)
SET(DEFAULT_INSTALL_LAYOUT "STANDALONE")
ENDIF()
SET(INSTALL_LAYOUT "${DEFAULT_INSTALL_LAYOUT}"
-CACHE STRING "Installation directory layout. Options are: STANDALONE (as in zip or tar.gz installer) or UNIX")
+CACHE STRING "Installation directory layout. Options are: STANDALONE (as in zip or tar.gz installer), RPM, DEB, SVR4")
IF(UNIX)
IF(INSTALL_LAYOUT MATCHES "RPM")
SET(default_prefix "/usr")
ELSEIF(INSTALL_LAYOUT MATCHES "DEB")
- SET(default_prefix "/opt/${MYSQL_BASE_VERSION}")
+ SET(default_prefix "/opt/mysql/server-${MYSQL_BASE_VERSION}")
# This is required to avoid "cpack -GDEB" default of prefix=/usr
SET(CPACK_SET_DESTDIR ON)
ELSEIF(INSTALL_LAYOUT MATCHES "SVR4")
@@ -83,12 +86,26 @@ IF(UNIX)
SET(CMAKE_INSTALL_PREFIX ${default_prefix}
CACHE PATH "install prefix" FORCE)
ENDIF()
+ SET(VALID_INSTALL_LAYOUTS "RPM" "STANDALONE" "DEB" "SVR4")
+ LIST(FIND VALID_INSTALL_LAYOUTS "${INSTALL_LAYOUT}" ind)
+ IF(ind EQUAL -1)
+ MESSAGE(FATAL_ERROR "Invalid INSTALL_LAYOUT parameter:${INSTALL_LAYOUT}."
+ " Choose between ${VALID_INSTALL_LAYOUTS}" )
+ ENDIF()
+
SET(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc"
CACHE PATH "config directory (for my.cnf)")
MARK_AS_ADVANCED(SYSCONFDIR)
ENDIF()
#
+# plugin_tests's value should not be used by imported plugins,
+# just use if(INSTALL_PLUGINTESTDIR).
+# The plugin must set its own install path for tests
+#
+FILE(GLOB plugin_tests ${CMAKE_SOURCE_DIR}/plugin/*/tests)
+
+#
# STANDALONE layout
#
SET(INSTALL_BINDIR_STANDALONE "bin")
@@ -112,6 +129,7 @@ SET(INSTALL_SQLBENCHDIR_STANDALONE ".")
SET(INSTALL_SUPPORTFILESDIR_STANDALONE "support-files")
#
SET(INSTALL_MYSQLDATADIR_STANDALONE "data")
+SET(INSTALL_PLUGINTESTDIR_STANDALONE ${plugin_tests})
#
# RPM layout
@@ -142,6 +160,7 @@ SET(INSTALL_SQLBENCHDIR_RPM "")
SET(INSTALL_SUPPORTFILESDIR_RPM "share/mysql")
#
SET(INSTALL_MYSQLDATADIR_RPM "/var/lib/mysql")
+SET(INSTALL_PLUGINTESTDIR_RPM ${plugin_tests})
#
# DEB layout
@@ -167,6 +186,7 @@ SET(INSTALL_SQLBENCHDIR_DEB ".")
SET(INSTALL_SUPPORTFILESDIR_DEB "support-files")
#
SET(INSTALL_MYSQLDATADIR_DEB "data")
+SET(INSTALL_PLUGINTESTDIR_DEB ${plugin_tests})
#
# SVR4 layout
@@ -192,6 +212,7 @@ SET(INSTALL_SQLBENCHDIR_SVR4 ".")
SET(INSTALL_SUPPORTFILESDIR_SVR4 "support-files")
#
SET(INSTALL_MYSQLDATADIR_SVR4 "/var/lib/mysql")
+SET(INSTALL_PLUGINTESTDIR_SVR4 ${plugin_tests})
# Clear cached variables if install layout was changed
@@ -206,7 +227,7 @@ SET(OLD_INSTALL_LAYOUT ${INSTALL_LAYOUT} CACHE INTERNAL "")
# will be defined as ${INSTALL_BINDIR_STANDALONE} by default if STANDALONE
# layout is chosen)
FOREACH(var BIN SBIN LIB MYSQLSHARE SHARE PLUGIN INCLUDE SCRIPT DOC MAN
- INFO MYSQLTEST SQLBENCH DOCREADME SUPPORTFILES MYSQLDATA)
+ INFO MYSQLTEST SQLBENCH DOCREADME SUPPORTFILES MYSQLDATA PLUGINTEST)
SET(INSTALL_${var}DIR ${INSTALL_${var}DIR_${INSTALL_LAYOUT}}
CACHE STRING "${var} installation directory" ${FORCE})
MARK_AS_ADVANCED(INSTALL_${var}DIR)