lgogdownloader/man/CMakeLists.txt

21 lines
673 B
CMake
Raw Normal View History

find_program(GZIP gzip DOC "Location of the gzip program")
mark_as_advanced(GZIP)
include(GNUInstallDirs)
2024-06-04 16:20:25 +02:00
if(GZIP)
set(MAN_PAGE "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.1")
set(MAN_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.1.gz")
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}
COMMENT "Building man page"
VERBATIM
)
add_custom_target(manpage ALL DEPENDS ${MAN_FILE} ${PROJECT_NAME})
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)