]> sigrok.org Git - pulseview.git/commitdiff
manual: accept absence of the asciidoctor-pdf exectuable
authorGerhard Sittig <redacted>
Sun, 14 Oct 2018 14:05:04 +0000 (16:05 +0200)
committerUwe Hermann <redacted>
Sat, 27 Oct 2018 19:25:22 +0000 (21:25 +0200)
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

index bdbd6c916d5e18c4b30d2e790bbcb7e99576690a..2cfd263f6185060d574f6f1bf6db48722ddfc30e 100644 (file)
@@ -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)