From b819f38e834bf804200377fe3cfd5942d7c44f0a Mon Sep 17 00:00:00 2001 From: David Adam Date: Fri, 23 Mar 2018 19:03:02 +1100 Subject: [PATCH] [cmake] fix selection of manual pages for installation --- cmake/Install.cmake | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/cmake/Install.cmake b/cmake/Install.cmake index 94fb3465f..e53741821 100644 --- a/cmake/Install.cmake +++ b/cmake/Install.cmake @@ -36,19 +36,18 @@ SET(extra_confdir ${datadir}/fish/vendor_conf.d CACHE STRING "Path for extra configuration") -# These are the man pages that go in system manpath. +# These are the man pages that go in system manpath; all manpages go in the fish-specific manpath. SET(MANUALS ${CMAKE_CURRENT_BINARY_DIR}/share/man/man1/fish.1 ${CMAKE_CURRENT_BINARY_DIR}/share/man/man1/fish_indent.1 ${CMAKE_CURRENT_BINARY_DIR}/share/man/man1/fish_key_reader.1) -# These are the manpages that go in fish-specific manpath. -FILE(GLOB HELP_MANPAGES share/man/man1/*.1) - -# Determine which man pages we don't want to install. +# Determine which man page we don't want to install. # On OS X, don't install a man page for open, since we defeat fish's open # function on OS X. IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - LIST(REMOVE_ITEM HELP_MANPAGES share/man/man1/open.1) + SET(CONDEMNED_PAGE "open.1") +ELSE() + SET(CONDEMNED_PAGE "none") ENDIF() # Define a function to help us create directories. @@ -160,10 +159,13 @@ INSTALL(DIRECTORY share/groff DESTINATION ${rel_datadir}/fish) # $v test -z "$(wildcard share/man/man1/*.1)" || $(INSTALL) -m 644 $(filter-out $(addprefix share/man/man1/, $(CONDEMNED_PAGES)), $(wildcard share/man/man1/*.1)) $(DESTDIR)$(datadir)/fish/man/man1/ -# CONDEMNED_PAGES is managed by the LIST() function after the glob +# CONDEMNED_PAGE is managed by the conditional above # Building the man pages is optional: if doxygen isn't installed, they're not built -INSTALL(FILES ${HELP_MANPAGES} - DESTINATION ${rel_datadir}/fish/man/man1) +INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/share/man/man1/ + DESTINATION ${rel_datadir}/fish/man/man1 + FILES_MATCHING + PATTERN "*.1" + PATTERN ${CONDEMNED_PAGE} EXCLUDE) # @echo "Installing helper tools"; # $v $(INSTALL) -m 755 share/tools/*.py $(DESTDIR)$(datadir)/fish/tools/