aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-06-10 12:06:52 +0200
committerPřemysl Eric Janouch <p@janouch.name>2023-06-10 12:12:42 +0200
commit2ed1c005c9f95c7b33e99cab38a53fc562c920bb (patch)
tree4e718707c4ed6a4dff0637009de430e16a55635f /CMakeLists.txt
parent26e73711b10a533fc45fa8839da9c6a7045fafe6 (diff)
downloadtdv-2ed1c005c9f95c7b33e99cab38a53fc562c920bb.tar.gz
tdv-2ed1c005c9f95c7b33e99cab38a53fc562c920bb.tar.xz
tdv-2ed1c005c9f95c7b33e99cab38a53fc562c920bb.zip
Import liberty for its manpage generator
It cannot parse the page well, so it's just a convenience fallback.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 10 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fd2cc27..86c49ff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -132,7 +132,8 @@ GETTEXT_CREATE_TRANSLATIONS (
find_program (ASCIIDOCTOR_EXECUTABLE asciidoctor)
find_program (A2X_EXECUTABLE a2x)
if (NOT ASCIIDOCTOR_EXECUTABLE AND NOT A2X_EXECUTABLE)
- message (FATAL_ERROR "Neither asciidoctor nor a2x were found")
+ message (WARNING "Neither asciidoctor nor a2x were found, "
+ "falling back to a substandard manual page generator")
endif ()
foreach (page "${PROJECT_NAME}.1")
@@ -154,6 +155,14 @@ foreach (page "${PROJECT_NAME}.1")
"${PROJECT_SOURCE_DIR}/docs/${page}.adoc"
DEPENDS "docs/${page}.adoc"
COMMENT "Generating man page for ${page}" VERBATIM)
+ else ()
+ set (ASCIIMAN ${PROJECT_SOURCE_DIR}/liberty/tools/asciiman.awk)
+ add_custom_command (OUTPUT ${page_output}
+ COMMAND env LC_ALL=C asciidoc-release-version=${PROJECT_VERSION}
+ awk -f ${ASCIIMAN} "${PROJECT_SOURCE_DIR}/docs/${page}.adoc"
+ > ${page_output}
+ DEPENDS "docs/${page}.adoc" ${ASCIIMAN}
+ COMMENT "Generating man page for ${page}" VERBATIM)
endif ()
endforeach ()