From: Michael Wallner Date: Tue, 18 Feb 2020 07:02:23 +0000 (+0100) Subject: docs: gzip manpages X-Git-Tag: post_cmake~10 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=c97065e8f496be4d36ffe020fba19c6be4c2a04e;p=m6w6%2Flibmemcached docs: gzip manpages --- diff --git a/CMakeConfig.txt b/CMakeConfig.txt index 5f1b47ab..3acae1cb 100644 --- a/CMakeConfig.txt +++ b/CMakeConfig.txt @@ -37,7 +37,10 @@ set(ENABLE_MEMASLAP ON set(ENABLE_DTRACE OFF CACHE BOOL "enable dtrace support") -# sphinx +# docs / sphinx + +set(GZIP_MAN ON + CACHE BOOL "gzip manpages") set(SPHINX_OPTIONS "" CACHE STRING "additional sphinx-build command line options") diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 269fae04..07709dd0 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -55,12 +55,29 @@ else() BYPRODUCTS ${SPHINX_MAN_DIR} ) + set(MAN_EXT "") + if(GZIP_MAN) + find_program(PIGZ pigz) + if(PIGZ) + set(GZIP ${PIGZ}) + else() + find_package(UnixCommands) + endif() + if(GZIP) + set(MAN_EXT ".gz") + add_custom_target(man_gz ALL + ${GZIP} -rkf ${SPHINX_MAN_DIR} + DEPENDS man + ) + endif() + endif() + install(DIRECTORY ${SPHINX_MAN_DIR}/ DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 - FILES_MATCHING PATTERN *.1 + FILES_MATCHING PATTERN *.1${MAN_EXT} ) install(DIRECTORY ${SPHINX_MAN_DIR}/ DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 - FILES_MATCHING PATTERN *.3 + FILES_MATCHING PATTERN *.3${MAN_EXT} ) endif()