diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-09-20 14:44:14 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-09-21 14:32:46 +0200 |
| commit | b713b919756fd420063e7defc30bfc21996de636 (patch) | |
| tree | 59e0f3bcd8dcb4c27413f3f533c27a6e2d2bea87 /documentation/CMakeLists.txt | |
| parent | f072cec13fb7afcc7726bda38869825f963bb483 (diff) | |
PDF docs: generate LaTeX header file from source
The LaTeX header file used when creating PDF documentation depends on
the doxygen and latex versions, respectively.
The old header file 'documentation/src/fltk-book.tex.in' had been
generated manually and needed to be updated for new doxygen versions
which made the PDF documentation generation dependent on the
doxygen/latex versions on the build system.
The new LaTeX header file 'fltk-book.tex' is generated by doxygen,
i.e. taking into account the doxygen and latex versions on the build
system and "edited" to include the page title defined in the new
file 'documentation/src/fltk-title.tex.in'.
This makes the PDF documentation independent of the doxygen and
latex versions of the build system.
Diffstat (limited to 'documentation/CMakeLists.txt')
| -rw-r--r-- | documentation/CMakeLists.txt | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/documentation/CMakeLists.txt b/documentation/CMakeLists.txt index c240531e5..acbdc6aeb 100644 --- a/documentation/CMakeLists.txt +++ b/documentation/CMakeLists.txt @@ -36,13 +36,13 @@ if (OPTION_BUILD_HTML_DOCUMENTATION) set (GENERATE_LATEX NO) set (LATEX_HEADER "") - configure_file( + configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY ) - configure_file( + configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/src/tiny.png ${CMAKE_CURRENT_BINARY_DIR}/html/tiny.png COPYONLY @@ -51,7 +51,6 @@ if (OPTION_BUILD_HTML_DOCUMENTATION) # generate html docs add_custom_target (html - # ALL ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating HTML documentation" VERBATIM @@ -73,28 +72,31 @@ if (OPTION_BUILD_PDF_DOCUMENTATION) set (GENERATE_LATEX YES) set (LATEX_HEADER "${CMAKE_CURRENT_BINARY_DIR}/fltk-book.tex") - configure_file( + # strip potential " (Git-hash)" from the original version + string (REGEX REPLACE " .*$" "" DOXY_VERSION ${DOXYGEN_VERSION}) + execute_process (COMMAND date +%Y + OUTPUT_VARIABLE YEAR + ) + + configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxybook @ONLY ) - # generate LaTeX header fltk-book.tex - - set (DOXY_VERSION ${DOXYGEN_VERSION}) - execute_process (COMMAND date +%Y - OUTPUT_VARIABLE YEAR - ) - - configure_file (${CMAKE_CURRENT_SOURCE_DIR}/src/fltk-book.tex.in - ${CMAKE_CURRENT_BINARY_DIR}/fltk-book.tex + configure_file ( + ${CMAKE_CURRENT_SOURCE_DIR}/src/fltk-title.tex.in + ${CMAKE_CURRENT_BINARY_DIR}/fltk-title.tex @ONLY ) # generate fltk.pdf - add_custom_command( + add_custom_command ( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fltk.pdf + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/make_header + ${CMAKE_CURRENT_BINARY_DIR}/fltk-title.tex + ${CMAKE_CURRENT_BINARY_DIR}/fltk-book.tex COMMAND ${DOXYGEN_EXECUTABLE} Doxybook COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/make_pdf COMMAND cp -f latex/refman.pdf fltk.pdf @@ -105,7 +107,6 @@ if (OPTION_BUILD_PDF_DOCUMENTATION) # add target 'pdf' add_custom_target (pdf - # ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/fltk.pdf ) @@ -117,8 +118,7 @@ endif (OPTION_BUILD_PDF_DOCUMENTATION) if (DOCS) - add_custom_target(docs - # ALL + add_custom_target (docs DEPENDS ${DOCS} ) |
