Build: Use GNUInstallDirs, install man pages #2649

For now, only install man pages matching "nvim*.1": we don't want to
install xxd.1 as it might conflict with that of a user's Vim
installation.

closes #1826

Reviewed-by: Florian Walch <florian@fwalch.com>
Helped-by: John Szakmeister <john@szakmeister.net>
This commit is contained in:
Michael Reed 2015-05-17 14:45:30 -04:00
parent d9acfbd471
commit aa1d9a1807
3 changed files with 17 additions and 5 deletions

View File

@ -271,9 +271,17 @@ endif()
# If it's preexisting, leave it alone.
include(InstallHelpers)
file(GLOB MANPAGES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
man/nvim*.1)
install_helper(
FILES ${MANPAGES}
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
install_helper(
DIRECTORY runtime
DESTINATION share/nvim)
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim)
file(GLOB_RECURSE RUNTIME_PROGRAMS
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
@ -281,11 +289,12 @@ file(GLOB_RECURSE RUNTIME_PROGRAMS
foreach(PROG ${RUNTIME_PROGRAMS})
get_filename_component(BASEDIR ${PROG} PATH)
install_helper(PROGRAMS ${PROG} DESTINATION share/nvim/${BASEDIR})
install_helper(PROGRAMS ${PROG} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/${BASEDIR})
endforeach()
install(SCRIPT ${PROJECT_SOURCE_DIR}/cmake/GenerateHelptags.cmake)
# Go down the tree.
add_subdirectory(src/nvim)

View File

@ -1,3 +1,6 @@
# For $CMAKE_INSTALL_{DATAROOT,MAN, ...}DIR
include(GNUInstallDirs)
# This will create any directories that need to be created in the destination
# path with the typical owner, group, and user permissions--independent of the
# umask setting.
@ -107,11 +110,11 @@ function(install_helper)
if(_install_helper_TARGETS)
# Ensure the bin area exists with the correct permissions.
create_install_dir_with_perms(DESTINATION bin)
create_install_dir_with_perms(DESTINATION ${CMAKE_INSTALL_BINDIR})
install(
TARGETS ${_install_helper_TARGETS}
RUNTIME DESTINATION bin)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
else()
create_install_dir_with_perms(
DESTINATION ${_install_helper_DESTINATION}

View File

@ -72,7 +72,7 @@ if(HAVE_WORKING_LIBINTL AND GETTEXT_FOUND AND XGETTEXT_PRG AND ICONV_PRG)
install_helper(
FILES ${moFile}
DESTINATION share/locale/${name}/LC_MESSAGES
DESTINATION ${CMAKE_INSTALL_LOCALEDIR}/${name}/LC_MESSAGES
RENAME nvim.mo)
list(APPEND LANGUAGE_MO_FILES ${moFile})