From: Gerhard Sittig Date: Sun, 14 Oct 2018 14:05:04 +0000 (+0200) Subject: manual: accept absence of the asciidoctor-pdf exectuable X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=6bbbf1f857f4e1b0de3da37a1a184f27a8ee41c7;p=pulseview.git manual: accept absence of the asciidoctor-pdf exectuable The asciidoctor(1) executable is considered mandatory when building the Pulseview manual. The asciidoctor-pdf(1) executable is not universally available (is missing in Debian), accept its absence, avoid execution failure in that case. This implementation replaces the actual .txt to .pdf conversion with a mere echo(1) message, which may go unnoticed in verbose build output. "make --no-print-directories manual" may be required to remain aware. --- diff --git a/manual/CMakeLists.txt b/manual/CMakeLists.txt index bdbd6c91..2cfd263f 100644 --- a/manual/CMakeLists.txt +++ b/manual/CMakeLists.txt @@ -38,17 +38,26 @@ add_custom_target(manual-html WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating manual, HTML output" ) -add_custom_target(manual-pdf - COMMAND ${ASCIIDOCTOR_PDF_EXECUTABLE} - -a stylesheet=${STYLE_SHEET} - -a stylesdir=${STYLES_DIR} - --destination-dir=${CMAKE_CURRENT_BINARY_DIR} - ${MANUAL_SRC} - BYPRODUCTS ${MANUAL_OUT_PDF} - DEPENDS ${MANUAL_SRC} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Generating manual, HTML output" -) +if (ASCIIDOCTOR_PDF_EXECUTABLE) + add_custom_target(manual-pdf + COMMAND ${ASCIIDOCTOR_PDF_EXECUTABLE} + -a stylesheet=${STYLE_SHEET} + -a stylesdir=${STYLES_DIR} + --destination-dir=${CMAKE_CURRENT_BINARY_DIR} + ${MANUAL_SRC} + BYPRODUCTS ${MANUAL_OUT_PDF} + DEPENDS ${MANUAL_SRC} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating manual, HTML output" + ) +else () + add_custom_target(manual-pdf + COMMAND ${CMAKE_COMMAND} -E echo + "asciidoctor-pdf executable is missing, NOT generating HTML output" + DEPENDS ${MANUAL_SRC} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) +endif () add_custom_target(manual) add_dependencies(manual manual-html manual-pdf)