From e6bc4b9da448820743ade916fec1411a78e2c169 Mon Sep 17 00:00:00 2001 From: Gerhard Sittig Date: Sun, 14 Oct 2018 17:06:16 +0200 Subject: [PATCH] manual: also install images/*.png with the HTML output Extend the CMake rules for the manual. Do install the images/ subdir but omit the *.xcf files. Prepare the CSS file although this seems to be not strictly necessary (gets inlined, but we are prepared if it's external). Only install these additional files when the asciidoctor(1) tool is available, and thus the .html file can get generated (to not install some questionable combination of a .pdf and unrelated .png files, or to not install the resources when none of the manual files got created). This approach was tested with the following command sequence: $ make manual $ make install $ xdg-open ~/share/doc/pulseview/*.html --- manual/CMakeLists.txt | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/manual/CMakeLists.txt b/manual/CMakeLists.txt index 2cfd263..25a26e9 100644 --- a/manual/CMakeLists.txt +++ b/manual/CMakeLists.txt @@ -20,7 +20,7 @@ find_program(ASCIIDOCTOR_EXECUTABLE NAMES asciidoctor) find_program(ASCIIDOCTOR_PDF_EXECUTABLE NAMES asciidoctor-pdf) -set(STYLES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/asciidoctor-stylesheet-factory/stylesheets") +set(STYLES_DIR "asciidoctor-stylesheet-factory/stylesheets") set(STYLE_SHEET "readthedocs.css") set(MANUAL_SRC "${CMAKE_CURRENT_SOURCE_DIR}/pulseview_manual.txt") set(MANUAL_OUT_HTML "${CMAKE_CURRENT_BINARY_DIR}/pulseview_manual.html") @@ -29,7 +29,7 @@ set(MANUAL_OUT_PDF "${CMAKE_CURRENT_BINARY_DIR}/pulseview_manual.pdf") add_custom_target(manual-html COMMAND ${ASCIIDOCTOR_EXECUTABLE} -a stylesheet=${STYLE_SHEET} - -a stylesdir=${STYLES_DIR} + -a stylesdir=${CMAKE_CURRENT_SOURCE_DIR}/${STYLES_DIR} -a toc=left --destination-dir=${CMAKE_CURRENT_BINARY_DIR} ${MANUAL_SRC} @@ -42,7 +42,7 @@ if (ASCIIDOCTOR_PDF_EXECUTABLE) add_custom_target(manual-pdf COMMAND ${ASCIIDOCTOR_PDF_EXECUTABLE} -a stylesheet=${STYLE_SHEET} - -a stylesdir=${STYLES_DIR} + -a stylesdir=${CMAKE_CURRENT_SOURCE_DIR}/${STYLES_DIR} --destination-dir=${CMAKE_CURRENT_BINARY_DIR} ${MANUAL_SRC} BYPRODUCTS ${MANUAL_OUT_PDF} @@ -61,9 +61,18 @@ endif () add_custom_target(manual) add_dependencies(manual manual-html manual-pdf) +set(MANUAL_INST_SUBDIR "share/doc/pulseview") install( FILES ${MANUAL_OUT_HTML} ${MANUAL_OUT_PDF} - DESTINATION "share/doc/pulseview" + DESTINATION ${MANUAL_INST_SUBDIR} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ OPTIONAL ) +if (ASCIIDOCTOR_EXECUTABLE) + install( + DIRECTORY images + DESTINATION ${MANUAL_INST_SUBDIR} + FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + PATTERN "*.xcf" EXCLUDE + ) +endif () -- 2.30.2