Add doxygen doc generation to makefiles

This commit is contained in:
Adam Sapek 2015-07-06 11:03:24 -07:00
Родитель a7429777c1
Коммит c9a83144fa
3 изменённых файлов: 61 добавлений и 50 удалений

Просмотреть файл

@ -51,19 +51,19 @@ function (add_pandoc_markdown)
add_dependencies (documentation "documentation_${name}")
endfunction()
find_haskell_program (pandoc)
if (Haskell_PANDOC_EXECUTABLE)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/manual/gbc.html"
COMMAND ${CMAKE_COMMAND} -E copy .pandoc/templates/cmdargs.html "${CMAKE_CURRENT_BINARY_DIR}/html/manual/gbc.html"
COMMAND ${GBC_EXECUTABLE} --help=html >> "${CMAKE_CURRENT_BINARY_DIR}/html/manual/gbc.html"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS .pandoc/templates/cmdargs.html ${GBC_EXECUTABLE})
DEPENDS .pandoc/templates/cmdargs.html gbc ${GBC_EXECUTABLE})
add_custom_target (documentation
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/manual/gbc.html")
find_haskell_program (pandoc)
if (Haskell_PANDOC_EXECUTABLE)
add_pandoc_markdown (src/bond_py.md src/bond_cpp.md
CODE "cpp,numberLines"
OPTIONS --self-contained --table-of-contents
@ -95,3 +95,30 @@ if (Haskell_PANDOC_EXECUTABLE)
CODE python)
endif()
find_program (Doxygen_EXECUTABLE doxygen.exe)
if (Doxygen_EXECUTABLE)
set (doxygen_sources
doxygen/bond.doxygen
doxygen/bond_layout.xml
doxygen/bond_reference.css
doxygen/mainpage.md)
set (doxygen_output_dir
"${CMAKE_CURRENT_BINARY_DIR}/html/reference")
add_custom_command(
OUTPUT "${doxygen_output_dir}/cpp/index.html"
COMMAND ${CMAKE_COMMAND}
-DDoxygen_EXECUTABLE=${Doxygen_EXECUTABLE}
-DDoxygen_OUTPUT_DIR=${doxygen_output_dir}
-P doxygen/doxygen.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${doxygen_sources})
add_custom_target (documentation_cpp_reference
DEPENDS "${doxygen_output_dir}/cpp/index.html"
SOURCES ${doxygen_sources})
add_dependencies (documentation documentation_cpp_reference)
endif()

Просмотреть файл

@ -52,7 +52,7 @@ PROJECT_LOGO =
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = ../html/reference
OUTPUT_DIRECTORY = "$(BOND_DOXYGEN_OUTPUT_DIR)"
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output
@ -324,22 +324,6 @@ INLINE_SIMPLE_STRUCTS = NO
TYPEDEF_HIDES_STRUCT = NO
# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
# determine which symbols to keep in memory and which to flush to disk.
# When the cache is full, less often used symbols will be written to disk.
# For small to medium size projects (<1000 input files) the default value is
# probably good enough. For larger projects a too small cache size can cause
# doxygen to be busy swapping symbols to and from disk most of the time
# causing a significant performance penalty.
# If the system has enough physical memory increasing the cache will improve the
# performance by keeping more symbols in memory. Note that the value works on
# a logarithmic scale so increasing the size by one will roughly double the
# memory usage. The cache size is given by this formula:
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
# corresponding to a cache size of 2^16 = 65536 symbols.
SYMBOL_CACHE_SIZE = 0
# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
# their name and scope. Since this can be an expensive process and often the
@ -589,7 +573,7 @@ FILE_VERSION_FILTER =
# You can optionally specify a file name after the option, if omitted
# DoxygenLayout.xml will be used as the name of the layout file.
LAYOUT_FILE = bond_layout.xml
LAYOUT_FILE = doxygen/bond_layout.xml
# The CITE_BIB_FILES tag can be used to specify one or more bib files
# containing the references data. This must be a list of .bib files. The
@ -661,7 +645,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = mainpage.md ../../cpp/inc/bond
INPUT = doxygen/mainpage.md ../cpp/inc/bond
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@ -693,7 +677,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE = ../../cpp/inc/bond/protocol/detail/rapidjson
EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
@ -915,7 +899,7 @@ HTML_STYLESHEET =
# robust against future updates. Doxygen will copy the style sheet file to
# the output directory.
HTML_EXTRA_STYLESHEET = bond_reference.css
HTML_EXTRA_STYLESHEET = doxygen/bond_reference.css
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
@ -1410,18 +1394,6 @@ GENERATE_XML = NO
XML_OUTPUT = xml
# The XML_SCHEMA tag can be used to specify an XML schema,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_SCHEMA =
# The XML_DTD tag can be used to specify an XML DTD,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_DTD =
# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
# dump the program listings (including syntax highlighting
# and cross-referencing information) to the XML output. Note that

12
doc/doxygen/doxygen.cmake Normal file
Просмотреть файл

@ -0,0 +1,12 @@
# Doxygen doesn't allow specifying output directory via command line arguments
# so we need this silly workaround to set environment variable that is then
# used in the .doxygen file.
set (ENV{BOND_DOXYGEN_OUTPUT_DIR} ${Doxygen_OUTPUT_DIR})
execute_process (
COMMAND ${Doxygen_EXECUTABLE} doxygen/bond.doxygen
RESULT_VARIABLE error)
if (error)
message (FATAL_ERROR)
endif()