MDEV-9209 - [PATCH] scripts: Do not prepend the prefix to absolute paths

Allow absolute paths for INSTALL_*DIR.
This commit is contained in:
Sergey Vojtovich 2015-12-16 17:29:26 +04:00
parent d8e127f9f4
commit c597ed0111
5 changed files with 36 additions and 31 deletions

View file

@ -283,7 +283,7 @@ IF(WIN32)
SET(SHAREDIR share)
ELSE()
SET(DEFAULT_MYSQL_HOME ${CMAKE_INSTALL_PREFIX})
SET(SHAREDIR ${DEFAULT_MYSQL_HOME}/${INSTALL_MYSQLSHAREDIR})
SET(SHAREDIR ${INSTALL_MYSQLSHAREDIRABS})
ENDIF()
SET(DEFAULT_BASEDIR "${DEFAULT_MYSQL_HOME}")

View file

@ -55,8 +55,8 @@ SET(CPACK_RPM_SPEC_MORE_DEFINE "
%define mysqldatadir ${INSTALL_MYSQLDATADIR}
%define mysqld_user mysql
%define mysqld_group mysql
%define _bindir ${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR}
%define _sbindir ${CMAKE_INSTALL_PREFIX}/${INSTALL_SBINDIR}
%define _bindir ${INSTALL_BINDIRABS}
%define _sbindir ${INSTALL_SBINDIRABS}
%define _sysconfdir ${INSTALL_SYSCONFDIR}
")

View file

@ -236,6 +236,12 @@ FOREACH(var BIN SBIN LIB MYSQLSHARE SHARE PLUGIN INCLUDE SCRIPT DOC MAN SYSCONF
SET(INSTALL_${var}DIR ${INSTALL_${var}DIR_${INSTALL_LAYOUT}}
CACHE STRING "${var} installation directory" ${FORCE})
MARK_AS_ADVANCED(INSTALL_${var}DIR)
IF(IS_ABSOLUTE ${INSTALL_${var}DIR})
SET(INSTALL_${var}DIRABS ${INSTALL_${var}DIR})
ELSE()
SET(INSTALL_${var}DIRABS "${CMAKE_INSTALL_PREFIX}/${INSTALL_${var}DIR}")
ENDIF()
ENDFOREACH()
IF(NOT MYSQL_UNIX_ADDR)

View file

@ -179,33 +179,32 @@ ENDIF(UNIX)
IF(INSTALL_LAYOUT MATCHES "STANDALONE")
SET(prefix ".")
ELSE()
SET(prefix "${CMAKE_INSTALL_PREFIX}")
ENDIF()
SET(bindir ${prefix}/${INSTALL_BINDIR})
SET(sbindir ${prefix}/${INSTALL_SBINDIR})
SET(scriptdir ${prefix}/${INSTALL_BINDIR})
SET(libexecdir ${prefix}/${INSTALL_SBINDIR})
SET(pkgdatadir ${prefix}/${INSTALL_MYSQLSHAREDIR})
IF(INSTALL_LAYOUT MATCHES "STANDALONE")
SET(bindir ${prefix}/${INSTALL_BINDIR})
SET(sbindir ${prefix}/${INSTALL_SBINDIR})
SET(scriptdir ${prefix}/${INSTALL_BINDIR})
SET(libexecdir ${prefix}/${INSTALL_SBINDIR})
SET(pkgdatadir ${prefix}/${INSTALL_MYSQLSHAREDIR})
SET(localstatedir ${prefix}/data)
ELSE()
SET(prefix "${CMAKE_INSTALL_PREFIX}")
SET(bindir ${INSTALL_BINDIRABS})
SET(sbindir ${INSTALL_SBINDIRABS})
SET(scriptdir ${INSTALL_BINDIRABS})
SET(libexecdir ${INSTALL_SBINDIRABS})
SET(pkgdatadir ${INSTALL_MYSQLSHAREDIRABS})
SET(localstatedir ${MYSQL_DATADIR})
ENDIF()
IF(UNIX)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.sh
${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY)
SET(DEST ${INSTALL_SCRIPTDIR})
SET(EXT)
EXECUTE_PROCESS(
COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db
)
INSTALL_SCRIPT(
"${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db"
DESTINATION ${DEST}
DESTINATION ${INSTALL_SCRIPTDIR}
COMPONENT Server
)
ENDIF()
@ -216,15 +215,15 @@ IF(INSTALL_SYSCONFDIR)
ELSE()
SET(sysconfdir "/etc")
ENDIF()
SET(bindir ${prefix}/${INSTALL_BINDIR})
SET(libexecdir ${prefix}/${INSTALL_SBINDIR})
SET(scriptdir ${prefix}/${INSTALL_BINDIR})
SET(datadir ${prefix}/${INSTALL_MYSQLSHAREDIR})
SET(pkgdatadir ${prefix}/${INSTALL_MYSQLSHAREDIR})
SET(bindir ${INSTALL_BINDIRABS})
SET(libexecdir ${INSTALL_SBINDIRABS})
SET(scriptdir ${INSTALL_BINDIRABS})
SET(datadir ${INSTALL_MYSQLSHAREDIRABS})
SET(pkgdatadir ${INSTALL_MYSQLSHAREDIRABS})
SET(libsubdir ${INSTALL_LIBDIR})
SET(pkgincludedir ${prefix}/${INSTALL_INCLUDEDIR})
SET(pkglibdir ${prefix}/${INSTALL_LIBDIR})
SET(pkgplugindir ${prefix}/${INSTALL_PLUGINDIR})
SET(pkgincludedir ${INSTALL_INCLUDEDIRABS})
SET(pkglibdir ${INSTALL_LIBDIRABS})
SET(pkgplugindir ${INSTALL_PLUGINDIRABS})
SET(localstatedir ${MYSQL_DATADIR})
SET(RPATH_OPTION "")

View file

@ -20,8 +20,8 @@ IF(WIN32)
ELSE()
SET(localstatedir "${MYSQL_DATADIR}")
SET(prefix "${CMAKE_INSTALL_PREFIX}")
SET(libexecdir "${CMAKE_INSTALL_PREFIX}/${INSTALL_SBINDIR}")
SET(bindir "${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR}" )
SET(libexecdir ${INSTALL_SBINDIRABS})
SET(bindir ${INSTALL_BINDIRABS})
SET(sbindir "${libexecdir}")
SET(datadir "${MYSQL_DATADIR}")
SET(CC ${CMAKE_C_COMPILER})
@ -66,11 +66,11 @@ IF(UNIX)
INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
SET(bindir ${prefix}/${INSTALL_BINDIR})
SET(sbindir ${prefix}/${INSTALL_SBINDIR})
SET(scriptdir ${prefix}/${INSTALL_SCRIPTDIR})
SET(libexecdir ${prefix}/${INSTALL_SBINDIR})
SET(pkgdatadir ${prefix}/${INSTALL_MYSQLSHAREDIR})
SET(bindir ${INSTALL_BINDIRABS})
SET(sbindir ${INSTALL_SBINDIRABS})
SET(scriptdir ${INSTALL_SCRIPTDIRABS})
SET(libexecdir ${INSTALL_SBINDIRABS})
SET(pkgdatadir ${INSTALL_MYSQLSHAREDIRABS})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql.server.sh
${CMAKE_CURRENT_BINARY_DIR}/mysql.server @ONLY)
INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/mysql.server