Commit 3de56134 authored by Sergei Golubchik's avatar Sergei Golubchik

INSTALL_DOCUMENTATION function for CMakeLists.txt

It puts files in the correct location for rpm/deb packages.
parent 588a1d65
......@@ -136,6 +136,7 @@ INCLUDE(mysql_version)
INCLUDE(cpack_source_ignore_files)
INCLUDE(install_layout)
INCLUDE(cpack_rpm)
INCLUDE(cpack_deb)
# Add macros
INCLUDE(character_sets)
......@@ -364,15 +365,12 @@ ADD_CUSTOM_TARGET(INFO_BIN ALL
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
INSTALL(FILES COPYING COPYING.LESSER LICENSE.mysql
DESTINATION ${INSTALL_DOCREADMEDIR}
COMPONENT Readme
OPTIONAL
)
INSTALL(FILES README DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme)
INSTALL(FILES ${CMAKE_BINARY_DIR}/Docs/INFO_SRC ${CMAKE_BINARY_DIR}/Docs/INFO_BIN DESTINATION ${INSTALL_DOCDIR})
INSTALL_DOCUMENTATION(README COPYING COPYING.LESSER
COMPONENT Readme)
INSTALL_DOCUMENTATION(${CMAKE_BINARY_DIR}/Docs/INFO_SRC
${CMAKE_BINARY_DIR}/Docs/INFO_BIN)
IF(UNIX)
INSTALL(FILES Docs/INSTALL-BINARY DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme)
INSTALL_DOCUMENTATION(Docs/INSTALL-BINARY COMPONENT Readme)
ENDIF()
INCLUDE(CPack)
......
#
# One day it'll be a complete solution for building deb packages with CPack
# But for now it's only to make INSTALL_DOCUMENTATION function happy
#
IF(DEB)
SET(CPACK_COMPONENT_SERVER_GROUP "server")
SET(CPACK_COMPONENT_README_GROUP "server")
ENDIF(DEB)
......@@ -156,8 +156,8 @@ ENDIF()
#
SET(INSTALL_INCLUDEDIR_RPM "include/mysql")
#
SET(INSTALL_DOCDIR_RPM "share/doc/${CPACK_SOURCE_PACKAGE_FILE_NAME}")
SET(INSTALL_DOCREADMEDIR_RPM "share/doc/${CPACK_SOURCE_PACKAGE_FILE_NAME}")
SET(INSTALL_DOCDIR_RPM "share/doc")
SET(INSTALL_DOCREADMEDIR_RPM "share/doc")
SET(INSTALL_INFODIR_RPM "share/info")
SET(INSTALL_MANDIR_RPM "share/man")
#
......@@ -184,8 +184,8 @@ SET(INSTALL_PLUGINDIR_DEB "lib/mysql/plugin")
#
SET(INSTALL_INCLUDEDIR_DEB "include/mysql")
#
SET(INSTALL_DOCDIR_DEB "share/doc/mariadb-server-5.5")
SET(INSTALL_DOCREADMEDIR_DEB "share/doc/mariadb-server-5.5")
SET(INSTALL_DOCDIR_DEB "share/doc")
SET(INSTALL_DOCREADMEDIR_DEB "share/doc")
SET(INSTALL_MANDIR_DEB "share/man")
SET(INSTALL_INFODIR_DEB "share/info")
#
......
......@@ -130,6 +130,36 @@ FUNCTION(INSTALL_SCRIPT)
INSTALL_MANPAGE(${script})
ENDFUNCTION()
FUNCTION(INSTALL_DOCUMENTATION)
MYSQL_PARSE_ARGUMENTS(ARG "COMPONENT" "" ${ARGN})
SET(files ${ARG_DEFAULT_ARGS})
IF(NOT ARG_COMPONENT)
SET(ARG_COMPONENT Server)
ENDIF()
IF (ARG_COMPONENT MATCHES "Readme")
SET(destination ${INSTALL_DOCREADMEDIR})
ELSE()
SET(destination ${INSTALL_DOCDIR})
ENDIF()
STRING(TOUPPER ${ARG_COMPONENT} COMPUP)
IF(CPACK_COMPONENT_${COMPUP}_GROUP)
SET(group ${CPACK_COMPONENT_${COMPUP}_GROUP})
ELSE()
SET(group ${ARG_COMPONENT})
ENDIF()
IF(RPM)
SET(destination "${destination}/MariaDB-${group}-${VERSION}")
ELSEIF(DEB)
SET(destination "${destination}/mariadb-${group}-${MAJOR_VERSION}.${MINOR_VERSION}")
ENDIF()
INSTALL(FILES ${files} DESTINATION ${destination} COMPONENT ${ARG_COMPONENT})
ENDFUNCTION()
# Install symbolic link to CMake target.
# the link is created in the same directory as target
# and extension will be the same as for target file.
......
usr/bin/tokuftdump
usr/lib/mysql/plugin/ha_tokudb.so
usr/share/doc/mariadb-server-5.5/tokudb/README-TOKUDB
usr/share/doc/mariadb-server-5.5/tokudb/README.md
usr/share/doc/mariadb-tokudb-engine-5.5/README-TOKUDB
usr/share/doc/mariadb-tokudb-engine-5.5/README.md
......@@ -57,11 +57,7 @@ add_subdirectory(include)
add_subdirectory(toku_include)
#add_subdirectory(examples)
install(
FILES README.md README-TOKUDB
COMPONENT "tokudb-engine"
DESTINATION "${INSTALL_DOCREADMEDIR}/tokudb"
)
INSTALL_DOCUMENTATION(README.md README-TOKUDB COMPONENT "tokudb-engine")
## build tags
#include(TokuBuildTagDatabases)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment