timewarrior/doc/CMakeLists.txt
Thomas Lauf b189ccb020 Replace roff man pages with asciidoctor
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>
2021-02-21 20:58:30 +01:00

20 lines
675 B
CMake

cmake_minimum_required (VERSION 2.8.12)
message ("-- Configuring documentation")
add_subdirectory (holidays)
add_subdirectory (themes)
if (ASCIIDOCTOR_FOUND)
set (ASCIIDOCTOR_OPTIONS "--attribute=manmanual=User Manuals"
"--attribute=mansource=timew ${PROJECT_VERSION}"
"--attribute=man-linkstyle='pass:[blue R < >]'")
add_subdirectory (man1)
add_subdirectory (man7)
add_custom_target (doc ALL DEPENDS man1 man7)
else (ASCIIDOCTOR_FOUND)
add_custom_target (doc ALL
COMMAND echo "Tool 'asciidoctor' is required to generate man pages! Please install it first.")
endif (ASCIIDOCTOR_FOUND)