Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate docs dependent figures in PNG and PDF formats separately #813

Merged
merged 3 commits into from
May 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ script:
# The default action for Travis-CI is to continue running even if a command fails.
- set -e
- if [[ "$BUILD_DOCS" == "true" ]]; then
cmake --build . --target docs_depends;
cmake --build . --target docs_html_depends;
cmake --build . --target docs_man_depends;
cmake --build . --target docs_pdf_depends;
(while sleep 300; do echo . ; done)&
cmake --build . --target animation;
kill %1;
Expand Down
7 changes: 5 additions & 2 deletions doc/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,12 @@ foreach (_script ${_examples})
endforeach (_script ${_examples})

# Add build target
add_custom_target (_docs_examples_fig DEPENDS ${_examples_pdf} ${_examples_png})
add_custom_target (_docs_examples_verbatim DEPENDS ${_examples_txt})
add_depend_to_target (docs_depends _docs_examples_fig _docs_examples_verbatim)
add_custom_target (_docs_html_examples_fig DEPENDS ${_examples_png})
add_custom_target (_docs_pdf_examples_fig DEPENDS ${_examples_pdf})
add_depend_to_target (docs_html_depends _docs_html_examples_fig _docs_examples_verbatim)
add_depend_to_target (docs_pdf_depends _docs_pdf_examples_fig _docs_examples_verbatim)
add_depend_to_target (docs_man_depends _docs_examples_verbatim)

# Animations
if (UNIX AND DO_ANIMATIONS)
Expand Down
4 changes: 3 additions & 1 deletion doc/fig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ endforeach (_fig ${_fig_fig})

# Add build target
add_custom_target (_docs_copy_fig DEPENDS ${_fig_fig_out})
add_depend_to_target (docs_depends _docs_copy_fig)
add_depend_to_target (docs_html_depends _docs_copy_fig)
add_depend_to_target (docs_pdf_depends _docs_copy_fig)
add_depend_to_target (docs_man_depends _docs_copy_fig)

# vim: textwidth=78 noexpandtab tabstop=2 softtabstop=2 shiftwidth=2
14 changes: 9 additions & 5 deletions doc/rst/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@ if (SPHINX_FOUND)
copy_dir_if_different (_docs_copy_rst_tree_source
${CMAKE_CURRENT_SOURCE_DIR}/source/
${CMAKE_CURRENT_BINARY_DIR}/_source)
add_depend_to_target (docs_depends _docs_copy_rst_tree_source)
add_depend_to_target (docs_html_depends _docs_copy_rst_tree_source)
add_depend_to_target (docs_pdf_depends _docs_copy_rst_tree_source)
add_depend_to_target (docs_man_depends _docs_copy_rst_tree_source)
copy_dir_if_different (_docs_copy_rst_tree_themes
${CMAKE_CURRENT_SOURCE_DIR}/themes/
${CMAKE_CURRENT_BINARY_DIR}/_themes)
add_depend_to_target (docs_depends _docs_copy_rst_tree_themes)
add_depend_to_target (docs_html_depends _docs_copy_rst_tree_themes)
add_depend_to_target (docs_pdf_depends _docs_copy_rst_tree_themes)
add_depend_to_target (docs_man_depends _docs_copy_rst_tree_themes)
add_custom_target (_docs_rst_mkdir_verbatim
COMMAND ${CMAKE_COMMAND} -E make_directory
${CMAKE_CURRENT_BINARY_DIR}/_source/_verbatim
Expand Down Expand Up @@ -67,7 +71,7 @@ if (SPHINX_FOUND)
${CMAKE_CURRENT_BINARY_DIR}/_source
${CMAKE_CURRENT_BINARY_DIR}/html
COMMENT "Building HTML documentation...")
add_dependencies (docs_html docs_depends)
add_dependencies (docs_html docs_html_depends)

# PDF build target
find_program(MAKE NAMES make gmake gnumake)
Expand All @@ -82,7 +86,7 @@ if (SPHINX_FOUND)
COMMAND ${MAKE} -C ${CMAKE_CURRENT_BINARY_DIR}/latex
all-pdf LATEXOPTS=-interaction=batchmode
COMMENT "Building CookBook PDF...")
add_dependencies (docs_pdf docs_depends)
add_dependencies (docs_pdf docs_pdf_depends)

# Shrink PDF files
find_program(GS NAMES gs gswin32c gswin64c)
Expand Down Expand Up @@ -115,7 +119,7 @@ if (SPHINX_FOUND)
${CMAKE_CURRENT_BINARY_DIR}/man
COMMAND ${GZIP} -9 -n -f ${CMAKE_CURRENT_BINARY_DIR}/man/*.?
COMMENT "Building manpages...")
add_dependencies (docs_man docs_depends)
add_dependencies (docs_man docs_man_depends)
endif (GZIP)

# Install targets for release documentation
Expand Down
6 changes: 4 additions & 2 deletions doc/scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,11 @@ foreach (_script ${_scr_strip})
endforeach (_script)

# Add build target
add_custom_target (_docs_scripts_fig DEPENDS ${_scripts_pdf} ${_scripts_png})
add_custom_target (_docs_scripts_verbatim DEPENDS ${_scripts_txt})
add_depend_to_target (docs_depends _docs_scripts_fig _docs_scripts_verbatim)
add_custom_target (_docs_html_scripts_fig DEPENDS ${_scripts_png})
add_custom_target (_docs_pdf_scripts_fig DEPENDS ${_scripts_pdf})
add_depend_to_target (docs_html_depends _docs_html_scripts_fig _docs_scripts_verbatim)
add_depend_to_target (docs_pdf_depends _docs_pdf_scripts_fig _docs_scripts_verbatim)

# run tests
if (DO_TESTS)
Expand Down