summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6bbbf1f)
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
find_program(ASCIIDOCTOR_EXECUTABLE NAMES asciidoctor)
find_program(ASCIIDOCTOR_PDF_EXECUTABLE NAMES asciidoctor-pdf)
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")
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")
add_custom_target(manual-html
COMMAND ${ASCIIDOCTOR_EXECUTABLE}
-a stylesheet=${STYLE_SHEET}
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}
-a toc=left
--destination-dir=${CMAKE_CURRENT_BINARY_DIR}
${MANUAL_SRC}
add_custom_target(manual-pdf
COMMAND ${ASCIIDOCTOR_PDF_EXECUTABLE}
-a stylesheet=${STYLE_SHEET}
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}
--destination-dir=${CMAKE_CURRENT_BINARY_DIR}
${MANUAL_SRC}
BYPRODUCTS ${MANUAL_OUT_PDF}
add_custom_target(manual)
add_dependencies(manual manual-html manual-pdf)
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}
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
)
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 ()