diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2022-08-24 00:43:14 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2022-08-24 00:55:32 +0200 |
commit | b0f1d3d6ea1b380e628958bd1b17ccb2c789ec2d (patch) | |
tree | cee4cc7f95b7a2dd89e36b4dae122a5639073490 /CMakeLists.txt | |
parent | 4073749d3bd11d73290bc37904efd77b84272270 (diff) | |
download | tdv-b0f1d3d6ea1b380e628958bd1b17ccb2c789ec2d.tar.gz tdv-b0f1d3d6ea1b380e628958bd1b17ccb2c789ec2d.tar.xz tdv-b0f1d3d6ea1b380e628958bd1b17ccb2c789ec2d.zip |
Build with AsciiDoc as well as Asciidoctor
And bump copyright years.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d740ec0..fd2cc27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,20 +130,31 @@ GETTEXT_CREATE_TRANSLATIONS ( # Documentation find_program (ASCIIDOCTOR_EXECUTABLE asciidoctor) -if (NOT ASCIIDOCTOR_EXECUTABLE) - message (FATAL_ERROR "asciidoctor not found") +find_program (A2X_EXECUTABLE a2x) +if (NOT ASCIIDOCTOR_EXECUTABLE AND NOT A2X_EXECUTABLE) + message (FATAL_ERROR "Neither asciidoctor nor a2x were found") endif () foreach (page "${PROJECT_NAME}.1") set (page_output "${PROJECT_BINARY_DIR}/${page}") list (APPEND project_MAN_PAGES "${page_output}") - add_custom_command (OUTPUT ${page_output} - COMMAND ${ASCIIDOCTOR_EXECUTABLE} -b manpage - -a release-version=${PROJECT_VERSION} - "${PROJECT_SOURCE_DIR}/docs/${page}.adoc" - -o "${page_output}" - DEPENDS "docs/${page}.adoc" - COMMENT "Generating man page for ${page}" VERBATIM) + if (ASCIIDOCTOR_EXECUTABLE) + add_custom_command (OUTPUT ${page_output} + COMMAND ${ASCIIDOCTOR_EXECUTABLE} -b manpage + -a release-version=${PROJECT_VERSION} + -o "${page_output}" + "${PROJECT_SOURCE_DIR}/docs/${page}.adoc" + DEPENDS "docs/${page}.adoc" + COMMENT "Generating man page for ${page}" VERBATIM) + elseif (A2X_EXECUTABLE) + add_custom_command (OUTPUT ${page_output} + COMMAND ${A2X_EXECUTABLE} --doctype manpage --format manpage + -a release-version=${PROJECT_VERSION} + -D "${PROJECT_BINARY_DIR}" + "${PROJECT_SOURCE_DIR}/docs/${page}.adoc" + DEPENDS "docs/${page}.adoc" + COMMENT "Generating man page for ${page}" VERBATIM) + endif () endforeach () add_custom_target (docs ALL DEPENDS ${project_MAN_PAGES}) |