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")
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()