This is done in meson with
|
asciidoc = find_program('asciidoctor', required: false) |
|
if asciidoc.found() |
|
install_man( |
|
configure_file( |
|
command: [asciidoc, '-b', 'manpage', '@INPUT@', '-o', '@OUTPUT@'], |
|
input: files('man/mctc-convert.1.adoc'), |
|
output: '@BASENAME@', |
|
) |
|
) |
|
endif |
and this can be included in cmake quite easily
find_program(ASCIIDOC_EXEC asciidoctor)
add_custom_target(man
COMMAND ${ASCIIDOC_EXEC} -b manpage man/mctc-convert.1.adoc -o mctc-convert
)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/mctc-convert.1"
DESTINATION "${CMAKE_INSTALL_MANDIR}/man1"
)
This is done in meson with
mctc-lib/meson.build
Lines 124 to 133 in 93dbc89
and this can be included in cmake quite easily