This commit is contained in:
parent
e53cddb030
commit
aea9c334e0
@ -138,19 +138,27 @@ endif ()
|
|||||||
|
|
||||||
# Generate documentation from help output
|
# Generate documentation from help output
|
||||||
if (NOT WIN32 AND NOT CMAKE_CROSSCOMPILING)
|
if (NOT WIN32 AND NOT CMAKE_CROSSCOMPILING)
|
||||||
find_program (HELP2MAN_EXECUTABLE help2man)
|
set (HELP2ADOC "${PROJECT_SOURCE_DIR}/liberty/tools/help2adoc.awk")
|
||||||
if (NOT HELP2MAN_EXECUTABLE)
|
set (ASCIIMAN "${PROJECT_SOURCE_DIR}/liberty/tools/asciiman.awk")
|
||||||
message (FATAL_ERROR "help2man not found")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
foreach (target ${targets})
|
foreach (target ${targets})
|
||||||
set (page_output "${PROJECT_BINARY_DIR}/${target}.1")
|
set (page_adoc "${PROJECT_BINARY_DIR}/${target}.1.adoc")
|
||||||
list (APPEND project_MAN_PAGES "${page_output}")
|
set (page_roff "${PROJECT_BINARY_DIR}/${target}.1")
|
||||||
add_custom_command (OUTPUT ${page_output}
|
list (APPEND project_MAN_PAGES "${page_roff}")
|
||||||
COMMAND ${HELP2MAN_EXECUTABLE} -N
|
|
||||||
"${PROJECT_BINARY_DIR}/${target}" -o ${page_output}
|
# $<TARGET_FILE:tgt> could be used, if we didn't have to escape it.
|
||||||
DEPENDS ${target}
|
string (REPLACE "\\" "\\\\"
|
||||||
COMMENT "Generating man page for ${target}" VERBATIM)
|
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 ()
|
endforeach ()
|
||||||
|
|
||||||
add_custom_target (docs ALL DEPENDS ${project_MAN_PAGES})
|
add_custom_target (docs ALL DEPENDS ${project_MAN_PAGES})
|
||||||
|
@ -59,7 +59,7 @@ https://git.janouch.name/p/usb-drivers/releases[the Releases page on Gitea].
|
|||||||
Building
|
Building
|
||||||
--------
|
--------
|
||||||
Build dependencies:
|
Build dependencies:
|
||||||
CMake, pkg-config, liberty (included), help2man +
|
CMake, pkg-config, liberty (included) +
|
||||||
Runtime dependencies:
|
Runtime dependencies:
|
||||||
libusb-1.0 (elksmart-comm, razer-bw-te-ctl), hidapi >= 0.14 (eizoctl)
|
libusb-1.0 (elksmart-comm, razer-bw-te-ctl), hidapi >= 0.14 (eizoctl)
|
||||||
|
|
||||||
|
2
liberty
2
liberty
@ -1 +1 @@
|
|||||||
Subproject commit 1930f138d4836f8ed9613a17bfe09dc53441618a
|
Subproject commit 9268fb8eba4a60499809965b3b69c2eb7e3798e7
|
Loading…
Reference in New Issue
Block a user