2016-01-03 22:50:29 +01:00
|
|
|
find_program(GZIP gzip DOC "Location of the gzip program")
|
|
|
|
mark_as_advanced(GZIP)
|
|
|
|
|
2017-08-29 11:52:40 +02:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
2024-06-04 16:20:25 +02:00
|
|
|
if(GZIP)
|
|
|
|
set(MAN_PAGE "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.1")
|
2018-12-20 10:12:58 +01:00
|
|
|
set(MAN_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.1.gz")
|
2016-01-03 22:50:29 +01:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${MAN_FILE}
|
2024-06-04 16:20:25 +02:00
|
|
|
COMMAND ${GZIP} -c -9 ${MAN_PAGE} > ${MAN_FILE}
|
|
|
|
MAIN_DEPENDENCY ${MAN_PAGE}
|
2016-01-03 22:50:29 +01:00
|
|
|
COMMENT "Building man page"
|
|
|
|
VERBATIM
|
|
|
|
)
|
|
|
|
add_custom_target(manpage ALL DEPENDS ${MAN_FILE} ${PROJECT_NAME})
|
2017-08-29 11:52:40 +02:00
|
|
|
install(FILES ${MAN_FILE} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
2024-06-04 16:20:25 +02:00
|
|
|
else(GZIP)
|
|
|
|
message("WARNING: One of the following is missing: gzip; man page will not be generated")
|
|
|
|
endif(GZIP)
|