From: Gerhard Sittig Date: Sun, 14 Oct 2018 15:06:16 +0000 (+0200) Subject: manual: also install images/*.png with the HTML output X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=commitdiff_plain;h=e6bc4b9da448820743ade916fec1411a78e2c169;hp=6bbbf1f857f4e1b0de3da37a1a184f27a8ee41c7 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 --- 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 ()