aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-08-24 01:09:02 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-08-24 01:09:30 +0200
commit3cf3c0215e776217a5ca0969462905ca22eba831 (patch)
treec1b7564057388b38fe9db3125dc416f811d2407e
parenta2a72c8b922b28219f899a1810c0a8832b5c6e3b (diff)
downloadjson-rpc-shell-3cf3c0215e776217a5ca0969462905ca22eba831.tar.gz
json-rpc-shell-3cf3c0215e776217a5ca0969462905ca22eba831.tar.xz
json-rpc-shell-3cf3c0215e776217a5ca0969462905ca22eba831.zip
Build with AsciiDoc as well as Asciidoctor
-rw-r--r--CMakeLists.txt29
-rw-r--r--README.adoc2
2 files changed, 21 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bfc7ed4..98a5291 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,20 +97,31 @@ install (FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
# Generate documentation from text markup
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})
set (page_output "${PROJECT_BINARY_DIR}/${page}.1")
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}/${page}.adoc"
- -o "${page_output}"
- DEPENDS ${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}/${page}.adoc"
+ DEPENDS ${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}/${page}.adoc"
+ DEPENDS ${page}.adoc
+ COMMENT "Generating man page for ${page}" VERBATIM)
+ endif ()
endforeach ()
add_custom_target (docs ALL DEPENDS ${project_MAN_PAGES})
diff --git a/README.adoc b/README.adoc
index be42b73..35412b4 100644
--- a/README.adoc
+++ b/README.adoc
@@ -34,7 +34,7 @@ a package with the latest development version from Archlinux's AUR.
Building
--------
-Build dependencies: CMake, pkg-config, asciidoctor,
+Build dependencies: CMake, pkg-config, asciidoctor or asciidoc,
liberty (included), http-parser (included) +
Runtime dependencies: libev, Jansson, cURL, openssl,
readline or libedit >= 2013-07-12,