diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2015-12-16 17:29:26 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2015-12-22 19:13:51 +0400 |
commit | c597ed01112c2f6549c59e6548d4ff53803487df (patch) | |
tree | 938550a7cdce894ef0f89152c2f2f6f5ac98b0eb | |
parent | d8e127f9f4eb634be2b84de3384709060db70b43 (diff) | |
download | mariadb-git-c597ed01112c2f6549c59e6548d4ff53803487df.tar.gz |
MDEV-9209 - [PATCH] scripts: Do not prepend the prefix to absolute paths
Allow absolute paths for INSTALL_*DIR.
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | cmake/cpack_rpm.cmake | 4 | ||||
-rw-r--r-- | cmake/install_layout.cmake | 6 | ||||
-rw-r--r-- | scripts/CMakeLists.txt | 41 | ||||
-rw-r--r-- | support-files/CMakeLists.txt | 14 |
5 files changed, 36 insertions, 31 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9399c839a2c..8d06f40d393 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}") diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake index cfef9eb1eed..f40a38ec775 100644 --- a/cmake/cpack_rpm.cmake +++ b/cmake/cpack_rpm.cmake @@ -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} ") diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake index 7c4639fe76c..757166b7c50 100644 --- a/cmake/install_layout.cmake +++ b/cmake/install_layout.cmake @@ -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) diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index eb780169324..01fd1c4f78f 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -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 "") diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt index c369e1d633d..eceff5fcf18 100644 --- a/support-files/CMakeLists.txt +++ b/support-files/CMakeLists.txt @@ -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 |