if(INSTALL_GUIDE_BUILD_IS_POSSIBLE)
# Do replacement of CMake variables for version strings, etc.
+ # This defers until build time the configuration of
+ # install-guide.md, which could be faster for all the
+ # configurations that don't make the install guide even though it
+ # was possible.
configure_file(configure-install-guide.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/configure-install-guide.cmake
@ONLY)
- # This defers until build time the configuration of
- # install-guide.md, which could be faster
+ # Configure the install-guide.md at build time
add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/install-guide.md
+ OUTPUT ${CMAKE_BINARY_DIR}/install-guide.md
COMMAND ${CMAKE_COMMAND}
-P ${CMAKE_CURRENT_BINARY_DIR}/configure-install-guide.cmake
DEPENDS
VERBATIM
)
- # Make the HTML install guide
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/install-guide.html
- COMMAND pandoc -t html -o ${CMAKE_CURRENT_BINARY_DIR}/install-guide.html install-guide.md -s --toc
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/install-guide.md
- VERBATIM
- )
-
# Make the INSTALL file for CPack for the tarball. This gets put
# into the tarball via the CPack rules in the top-level
# CMakeLists.txt
add_custom_command(
OUTPUT final/INSTALL
COMMAND ${CMAKE_COMMAND} -E make_directory final
- COMMAND pandoc -t plain -o final/INSTALL install-guide.md
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/install-guide.md
+ COMMAND ${PANDOC_EXECUTABLE} -t plain -o final/INSTALL install-guide.md
+ DEPENDS
+ ${CMAKE_BINARY_DIR}/install-guide.md
VERBATIM
)
- # Add a top-level target for the others to hook onto
+ # Make the single-page HTML install guide
+ add_custom_command(
+ OUTPUT ${HTML_OUTPUT_DIR}/install-guide.html
+ COMMAND
+ ${PANDOC_EXECUTABLE} install-guide.md -o ${HTML_OUTPUT_DIR}/install-guide.html -s --toc --css buttondown.css
+ DEPENDS
+ ${CMAKE_BINARY_DIR}/install-guide.md
+ VERBATIM
+ )
+
+ # Make the PDF install guide
+ add_custom_command(
+ OUTPUT ${HTML_OUTPUT_DIR}/install-guide.pdf
+ COMMAND
+ ${PANDOC_EXECUTABLE} install-guide.md -o ${HTML_OUTPUT_DIR}/install-guide.pdf -s --toc
+ DEPENDS
+ ${CMAKE_BINARY_DIR}/install-guide.md
+ VERBATIM
+ )
+
+ # Make the multi-page HTML install guide
+ #
+ # TODO This is currently disabled, because the pandoc-specific
+ # buttondown.css doesn't work with the different kind of output
+ # makeinfo produces. When we understand better how we want to
+ # do generation, decide whether we want multi-page HTML output
+ # and how to make it work well.
+ #
+ # add_custom_command(
+ # OUTPUT ${HTML_OUTPUT_DIR}/index.html
+ # COMMAND
+ # ${PANDOC_EXECUTABLE} install-guide.md -o install-guide.texi -s
+ # COMMAND
+ # ${MAKEINFO_EXECUTABLE} install-guide.texi --html -o ${HTML_OUTPUT_DIR}/install-guide --css-ref buttondown.css
+ # DEPENDS
+ # ${CMAKE_BINARY_DIR}/install-guide.md
+ # VERBATIM
+ # )
+
+ # Add a top-level target for the webpage build to hook onto
add_custom_target(install-guide
DEPENDS
- ${CMAKE_CURRENT_BINARY_DIR}/install-guide.html
- final/INSTALL
+ final/INSTALL
+ ${HTML_OUTPUT_DIR}/install-guide.html
+ ${HTML_OUTPUT_DIR}/install-guide.pdf
VERBATIM
)
endif()
+
+set(INSTALL_GUIDE_BUILD_IS_POSSIBLE ${INSTALL_GUIDE_BUILD_IS_POSSIBLE} PARENT_SCOPE)