From 6bbbf1f857f4e1b0de3da37a1a184f27a8ee41c7 Mon Sep 17 00:00:00 2001 From: Gerhard Sittig Date: Sun, 14 Oct 2018 16:05:04 +0200 Subject: [PATCH] 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. --- manual/CMakeLists.txt | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/manual/CMakeLists.txt b/manual/CMakeLists.txt index bdbd6c9..2cfd263 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) -- 2.30.2