Skip to content

Commit c055784

Browse files
committed
Do not accept invalid INSTALL_LAYOUT parameter
1 parent 0b29085 commit c055784

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

cmake/install_layout.cmake

+11-1
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,16 @@
5959
# - INSTALL_SUPPORTFILESDIR (various extra support files)
6060
#
6161
# - INSTALL_MYSQLDATADIR (data directory)
62+
#
63+
# When changing this page, _please_ do not forget to update public Wiki
64+
# http://forge.mysql.com/wiki/CMake#Fine-tuning_installation_paths
6265

6366
IF(NOT INSTALL_LAYOUT)
6467
SET(DEFAULT_INSTALL_LAYOUT "STANDALONE")
6568
ENDIF()
6669

6770
SET(INSTALL_LAYOUT "${DEFAULT_INSTALL_LAYOUT}"
68-
CACHE STRING "Installation directory layout. Options are: STANDALONE (as in zip or tar.gz installer) or UNIX")
71+
CACHE STRING "Installation directory layout. Options are: STANDALONE (as in zip or tar.gz installer), RPM, DEB, SVR4")
6972

7073
IF(UNIX)
7174
IF(INSTALL_LAYOUT MATCHES "RPM")
@@ -83,6 +86,13 @@ IF(UNIX)
8386
SET(CMAKE_INSTALL_PREFIX ${default_prefix}
8487
CACHE PATH "install prefix" FORCE)
8588
ENDIF()
89+
SET(VALID_INSTALL_LAYOUTS "RPM" "STANDALONE" "DEB" "SVR5")
90+
LIST(FIND VALID_INSTALL_LAYOUTS "${INSTALL_LAYOUT}" ind)
91+
IF(ind EQUAL -1)
92+
MESSAGE(FATAL_ERROR "Invalid INSTALL_LAYOUT parameter:${INSTALL_LAYOUT}."
93+
" Choose between ${VALID_INSTALL_LAYOUTS}" )
94+
ENDIF()
95+
8696
SET(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc"
8797
CACHE PATH "config directory (for my.cnf)")
8898
MARK_AS_ADVANCED(SYSCONFDIR)

0 commit comments

Comments
 (0)