From: Gerhard Sittig Date: Sat, 22 Apr 2023 07:20:21 +0000 (+0200) Subject: manual: symlink manual/images/ subdir for out-of-source builds X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=cfcda2e615f64f60fdda4583a6ff85d72d249d4d;p=pulseview.git manual: symlink manual/images/ subdir for out-of-source builds Execution of "make manual" created HTML output, but document inspection suffered from missing screenshots. Symlink the images/ subdirectory so that source file content is re-used in output hierarchies. This has gone unnoticed because "make install" references source files, and the manual author appears to not use out of source builds. Only out of source builds and only HTML output inspection before installation were affected. Installed manuals were not affected. How to reproduce: $ cmake --build $OUT --target manual $ xdg-open $OUT/manual/manual.html --- diff --git a/manual/CMakeLists.txt b/manual/CMakeLists.txt index 5a198b5c..3b881a56 100644 --- a/manual/CMakeLists.txt +++ b/manual/CMakeLists.txt @@ -36,6 +36,22 @@ set(MANUAL_SRC "${CMAKE_CURRENT_SOURCE_DIR}/manual.txt") set(MANUAL_OUT_HTML "${CMAKE_CURRENT_BINARY_DIR}/manual.html") set(MANUAL_OUT_PDF "${CMAKE_CURRENT_BINARY_DIR}/manual.pdf") +# Make in-source images/ content available to the output hierarchy for +# the inspection of created output documents during development in the +# case of out-of-source build configurations. +if (NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/images") + message(STATUS "creating symlink for manual's images/ subdirectory") + execute_process( + COMMAND ${CMAKE_COMMAND} -E create_symlink + "${CMAKE_CURRENT_SOURCE_DIR}/images" + "${CMAKE_CURRENT_BINARY_DIR}/images" + RESULT_VARIABLE IMAGES_LINK_RESULT + ) + if (NOT IMAGES_LINK_RESULT EQUAL 0) + message(WARNING "manual rendering will lack images") + endif () +endif () + # Manual related make(1) targets. add_custom_target(manual-html COMMAND ${ASCIIDOCTOR_EXECUTABLE}