mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00

This replaces the generation of man pages on project setup by a on-demand generation via asciidoctor. An exception are the man pages for the commands `day`, `month`, and `week` which are simply redirects to the man page `timew-chart.1`. Those are now static files in the Timewarrior repository. A CMake find module to detect asciidoctor was added. If asciidoctor is found, the targets `doc`, `man1`, and `man7` are created. Those targets are also added to the default build target. If asciidoctor is not available, the target `doc` is available, but it only emits a message to install asciidoctor first. Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
21 lines
647 B
CMake
21 lines
647 B
CMake
cmake_minimum_required (VERSION 2.8.12)
|
|
|
|
file (GLOB DOC_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/*.7.adoc")
|
|
set (DOC_FILES)
|
|
|
|
foreach (SRC ${DOC_SOURCES})
|
|
string (REPLACE ".adoc" "" OUTPUT_FILE_NAME "${SRC}")
|
|
|
|
add_custom_command (
|
|
OUTPUT "${OUTPUT_FILE_NAME}"
|
|
COMMAND ${ASCIIDOCTOR_EXECUTABLE} -b manpage ${ASCIIDOCTOR_OPTIONS} ${SRC} -o ${OUTPUT_FILE_NAME}
|
|
DEPENDS "${SRC}")
|
|
|
|
set (DOC_FILES ${DOC_FILES} "${OUTPUT_FILE_NAME}")
|
|
endforeach (SRC)
|
|
|
|
add_custom_target (man7 DEPENDS ${DOC_FILES})
|
|
|
|
install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
DESTINATION ${TIMEW_MANDIR}
|
|
FILES_MATCHING PATTERN "*.7")
|