aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-08-24 00:12:04 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-08-24 00:13:51 +0200
commita717782480426e834011d4f91b0c5cafa0b7a5a5 (patch)
treecb4d7cc1c17d20bf56b40121c9c89e1f0989b42b /CMakeLists.txt
parentc50c959f4d4861e0437f8e7825dbea1fbf72cae3 (diff)
downloadxK-a717782480426e834011d4f91b0c5cafa0b7a5a5.tar.gz
xK-a717782480426e834011d4f91b0c5cafa0b7a5a5.tar.xz
xK-a717782480426e834011d4f91b0c5cafa0b7a5a5.zip
Build with AsciiDoc as well as Asciidoctor
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt29
1 files changed, 20 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6ffe9b9..4b403f3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -204,20 +204,31 @@ install (DIRECTORY plugins/xC/
# 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 xB xC xD)
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})