aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2024-12-31 23:52:59 +0100
committerPřemysl Eric Janouch <p@janouch.name>2025-01-01 06:09:49 +0100
commitaea9c334e0f4842d78f3b849079bfb318d4f6937 (patch)
treee8879933b76e0e83ea95795f2ce9bfa7df20a4d5
parente53cddb030774765dec14ab120991fc775bc6959 (diff)
downloadusb-drivers-origin/master.tar.gz
usb-drivers-origin/master.tar.xz
usb-drivers-origin/master.zip
Bump liberty, replace help2man with help2adocHEADorigin/mastermaster
-rw-r--r--CMakeLists.txt30
-rw-r--r--README.adoc2
m---------liberty0
3 files changed, 20 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8beaf96..2e91b48 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -138,19 +138,27 @@ endif ()
# Generate documentation from help output
if (NOT WIN32 AND NOT CMAKE_CROSSCOMPILING)
- find_program (HELP2MAN_EXECUTABLE help2man)
- if (NOT HELP2MAN_EXECUTABLE)
- message (FATAL_ERROR "help2man not found")
- endif ()
+ set (HELP2ADOC "${PROJECT_SOURCE_DIR}/liberty/tools/help2adoc.awk")
+ set (ASCIIMAN "${PROJECT_SOURCE_DIR}/liberty/tools/asciiman.awk")
foreach (target ${targets})
- set (page_output "${PROJECT_BINARY_DIR}/${target}.1")
- list (APPEND project_MAN_PAGES "${page_output}")
- add_custom_command (OUTPUT ${page_output}
- COMMAND ${HELP2MAN_EXECUTABLE} -N
- "${PROJECT_BINARY_DIR}/${target}" -o ${page_output}
- DEPENDS ${target}
- COMMENT "Generating man page for ${target}" VERBATIM)
+ set (page_adoc "${PROJECT_BINARY_DIR}/${target}.1.adoc")
+ set (page_roff "${PROJECT_BINARY_DIR}/${target}.1")
+ list (APPEND project_MAN_PAGES "${page_roff}")
+
+ # $<TARGET_FILE:tgt> could be used, if we didn't have to escape it.
+ string (REPLACE "\\" "\\\\"
+ target_path "${PROJECT_BINARY_DIR}/${target}")
+ add_custom_command (OUTPUT "${page_adoc}"
+ COMMAND env LC_ALL=C awk -f "${HELP2ADOC}"
+ -v "Target=${target_path}" > "${page_adoc}"
+ DEPENDS "${target}" "${HELP2ADOC}"
+ COMMENT "Generating AsciiDoc man page for ${target}" VERBATIM)
+ add_custom_command (OUTPUT "${page_roff}"
+ COMMAND env LC_ALL=C awk -f "${ASCIIMAN}"
+ "${page_adoc}" > "${page_roff}"
+ DEPENDS "${page_adoc}" "${ASCIIMAN}"
+ COMMENT "Generating roff man page for ${target}" VERBATIM)
endforeach ()
add_custom_target (docs ALL DEPENDS ${project_MAN_PAGES})
diff --git a/README.adoc b/README.adoc
index 83d859e..99f8c74 100644
--- a/README.adoc
+++ b/README.adoc
@@ -59,7 +59,7 @@ https://git.janouch.name/p/usb-drivers/releases[the Releases page on Gitea].
Building
--------
Build dependencies:
- CMake, pkg-config, liberty (included), help2man +
+ CMake, pkg-config, liberty (included) +
Runtime dependencies:
libusb-1.0 (elksmart-comm, razer-bw-te-ctl), hidapi >= 0.14 (eizoctl)
diff --git a/liberty b/liberty
-Subproject 1930f138d4836f8ed9613a17bfe09dc53441618
+Subproject 9268fb8eba4a60499809965b3b69c2eb7e3798e