aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2020-10-26 17:01:43 +0100
committerPřemysl Eric Janouch <p@janouch.name>2020-10-26 17:06:13 +0100
commitd2fa9f315132bdb3134323c7d453a62a2681b136 (patch)
treeb43f989cb5d0f4694a43eb6592c460db54032f39 /CMakeLists.txt
parentd7f502a7314544916ccf019dcaee590918922498 (diff)
downloadtdv-d2fa9f315132bdb3134323c7d453a62a2681b136.tar.gz
tdv-d2fa9f315132bdb3134323c7d453a62a2681b136.tar.xz
tdv-d2fa9f315132bdb3134323c7d453a62a2681b136.zip
Convert the manpage to AsciiDoc
Writing DocBook XML by hand is an awful experience and the tools aren't much better. Asciidoctor does it well. There's no need to worry about semantics, man(1) just needs to be able to show something at all. This project's manpage is sadly almost useless right now.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt31
1 files changed, 13 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8f011b7..0eddb7c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -96,29 +96,24 @@ GETTEXT_CREATE_TRANSLATIONS (
ALL ${project_PO_FILES})
# Documentation
-find_program (XSLTPROC_EXECUTABLE xsltproc)
-if (NOT XSLTPROC_EXECUTABLE)
- message (FATAL_ERROR "xsltproc not found")
-endif (NOT XSLTPROC_EXECUTABLE)
+find_program (ASCIIDOCTOR_EXECUTABLE asciidoctor)
+if (NOT ASCIIDOCTOR_EXECUTABLE)
+ message (FATAL_ERROR "asciidoctor not found")
+endif (NOT ASCIIDOCTOR_EXECUTABLE)
-set (project_MAN_PAGES "${PROJECT_NAME}.1")
-foreach (page ${project_MAN_PAGES})
+foreach (page "${PROJECT_NAME}.1")
set (page_output "${PROJECT_BINARY_DIR}/${page}")
- list (APPEND project_MAN_PAGES_OUTPUT "${page_output}")
+ list (APPEND project_MAN_PAGES "${page_output}")
add_custom_command (OUTPUT ${page_output}
- COMMAND ${XSLTPROC_EXECUTABLE}
- --nonet
- --param make.year.ranges 1
- --param make.single.year.ranges 1
- --param man.charmap.use.subset 0
- --param man.authors.section.enabled 0
- http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
- "${PROJECT_SOURCE_DIR}/docs/${page}.xml"
- DEPENDS "docs/${page}.xml"
+ 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)
endforeach (page)
-add_custom_target (docs ALL DEPENDS ${project_MAN_PAGES_OUTPUT})
+add_custom_target (docs ALL DEPENDS ${project_MAN_PAGES})
# Project libraries
set (project_common_libraries ${ZLIB_LIBRARIES} ${icu_LIBRARIES}
@@ -182,7 +177,7 @@ include (GNUInstallDirs)
install (TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
install (FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
-foreach (page ${project_MAN_PAGES_OUTPUT})
+foreach (page ${project_MAN_PAGES})
string (REGEX MATCH "\\.([0-9])$" manpage_suffix "${page}")
install (FILES "${page}"
DESTINATION "${CMAKE_INSTALL_MANDIR}/man${CMAKE_MATCH_1}")