Added infrastructure to have cmake-based builds automatically generate PDF documentation when using Doxygen.

This commit is contained in:
Ward Fisher 2014-06-18 14:33:49 -06:00
parent 7baaeecb12
commit 45e41c79f9
5 changed files with 233 additions and 191 deletions

View File

@ -935,6 +935,14 @@ IF(ENABLE_DOXYGEN)
SET(SHOW_DOXYGEN_TODO_LIST NO CACHE STRING "")
ENDIF(ENABLE_DOXYGEN_TASKS)
OPTION(ENABLE_DOXYGEN_LATEX_OUTPUT "Turn on LaTeX output for Doxygen-generated documentation." OFF)
IF(ENABLE_DOXYGEN_LATEX_OUTPUT)
SET(NC_ENABLE_DOXYGEN_LATEX_OUTPUT "YES" CACHE STRING "")
ELSE()
SET(NC_ENABLE_DOXYGEN_LATEX_OUTPUT "NO" CACHE STRING "")
ENDIF()
# Specify whether or not 'dot' was found on the system path.
IF(NC_DOT)
SET(HAVE_DOT YES CACHE STRING "")

View File

@ -54,6 +54,40 @@ IF(ENABLE_DOXYGEN)
COMMENT "Generating Tutorial Tags" VERBATIM
)
# If ENABLE_DOXYGEN_LATEX_OUTPUT is true, automatically build
# the PDF files.
IF(ENABLE_DOXYGEN_LATEX_OUTPUT)
# Process 'main' netcdf documentation.
FIND_PROGRAM(NC_MAKE NAMES make)
IF(NOT NC_MAKE)
MESSAGE(STATUS "Unable to locate 'make' program. Unable to build pdf documentation.")
ELSE()
ADD_CUSTOM_TARGET(doc_all_pdf ALL
make
COMMAND mv refman.pdf ../netcdf.pdf
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/latex_main"
COMMENT "Building NetCDF PDF Documentation" VERBATIM
)
# Process 'guide' netcdf documentation.
ADD_CUSTOM_TARGET(doc_guide_pdf ALL
make
COMMAND mv refman.pdf ../netcdf-guide.pdf
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/latex_guide"
COMMENT "Building NetCDF-Guide PDF Documentation" VERBATIM
)
# Process 'tutorial' netcdf documentation.
ADD_CUSTOM_TARGET(doc_tutorial_pdf ALL
make
COMMAND mv refman.pdf ../netcdf-tutorial.pdf
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/latex_tutorial"
COMMENT "Building NetCDF-Tutorial PDF Documentation" VERBATIM
)
ENDIF()
ENDIF()
# Copy the image files used by markdown documentation
# manually.
FILE(GLOB IMG_FILES ${CMAKE_CURRENT_BINARY_DIR}/images/*.jpg

View File

@ -1570,7 +1570,7 @@ EXTRA_SEARCH_MAPPINGS =
# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
# The default value is: YES.
GENERATE_LATEX = NO
GENERATE_LATEX = @NC_ENABLE_DOXYGEN_LATEX_OUTPUT@
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
@ -1578,7 +1578,7 @@ GENERATE_LATEX = NO
# The default directory is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_OUTPUT = latex
LATEX_OUTPUT = latex_guide
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked.

View File

@ -1608,7 +1608,7 @@ EXTRA_SEARCH_MAPPINGS =
# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
# The default value is: YES.
GENERATE_LATEX = NO
GENERATE_LATEX = @NC_ENABLE_DOXYGEN_LATEX_OUTPUT@
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
@ -1616,7 +1616,7 @@ GENERATE_LATEX = NO
# The default directory is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_OUTPUT = latex
LATEX_OUTPUT = latex_main
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked.

View File

@ -1581,7 +1581,7 @@ EXTRA_SEARCH_MAPPINGS =
# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
# The default value is: YES.
GENERATE_LATEX = NO
GENERATE_LATEX = @NC_ENABLE_DOXYGEN_LATEX_OUTPUT@
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
@ -1589,7 +1589,7 @@ GENERATE_LATEX = NO
# The default directory is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_OUTPUT = latex
LATEX_OUTPUT = latex_tutorial
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked.