- # The targets ending with -fast do the same thing as the target without the
- # suffix, but assume that time-consuming dependencies have already been
- # built, making it faster and more convenient to test a single part of the
- # system.
- add_doxygen_target(doc-full full "Generating full documentation with Doxygen")
- add_doxygen_target(doc-full-fast full "Generating full documentation with Doxygen")
- add_doxygen_target(doc-lib lib "Generating library documentation with Doxygen")
- add_doxygen_target(doc-lib-fast lib "Generating library documentation with Doxygen")
- add_doxygen_target(doc-user user "Generating public API documentation with Doxygen")
- add_doxygen_target(doc-xml xml "Extracting Doxygen documentation to XML")
+
+ # The XML target is necessary for the dependency graphs
+ add_doxygen_target(doc-xml xml "Extracting Doxygen documentation to XML")
+
+ # Add targets for generating the dependency graphs; they are necessary for
+ # the full and lib variants of the documentation.
+ if (USE_PYTHON_SCRIPTS)
+ # Add target that generates .dot files for the dependency graphs.
+ # The output also depends on the Doxygen source files, but the
+ # dependency on doc-xml takes care of that transitively.
+ gmx_add_custom_output_target(dep-graphs-dot ADD_FAST_TARGET
+ OUTPUT STAMP
+ COMMAND ${PYTHON_EXECUTABLE}
+ ${CMAKE_CURRENT_SOURCE_DIR}/graphbuilder.py
+ -S ${CMAKE_SOURCE_DIR} -B ${CMAKE_BINARY_DIR}
+ --ignore-cycles ${CMAKE_CURRENT_SOURCE_DIR}/cycle-suppressions.txt
+ -o ${DEPGRAPH_DIR}
+ DEPENDS doc-xml find-installed-headers
+ ${CMAKE_CURRENT_SOURCE_DIR}/doxygenxml.py
+ ${CMAKE_CURRENT_SOURCE_DIR}/gmxtree.py
+ ${CMAKE_CURRENT_SOURCE_DIR}/graphbuilder.py
+ ${CMAKE_CURRENT_SOURCE_DIR}/cycle-suppressions.txt
+ COMMENT "Generating include dependency graphs for dot")
+ add_dependencies(dep-graphs-dot-fast find-installed-headers)
+
+ # Add separate targets for converting the .dot files to .png.
+ # These are not needed by the Doxygen targets, but are useful for
+ # investigating just the graphs.
+ set(dep_graphs_command_dot
+ ${CMAKE_COMMAND} -DGRAPHDIR=${DEPGRAPH_DIR}
+ -DDOT_EXECUTABLE=${DOXYGEN_DOT_EXECUTABLE}
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/generateGraphs.cmake)
+ add_custom_target(dep-graphs COMMAND ${dep_graphs_command_dot}
+ COMMENT "Generating PNG include dependency graphs" VERBATIM)
+ add_custom_target(dep-graphs-fast COMMAND ${dep_graphs_command_dot}
+ COMMENT "Generating PNG include dependency graphs" VERBATIM)
+ add_dependencies(dep-graphs dep-graphs-dot)
+ add_dependencies(dep-graphs-fast dep-graphs-dot-fast)
+ endif()
+
+ # Create the actual targets to build the documentation.
+ add_doxygen_target(doc-full full "Generating full documentation with Doxygen" DEPGRAPHS)
+ add_doxygen_target(doc-lib lib "Generating library documentation with Doxygen" DEPGRAPHS)
+ add_doxygen_target(doc-user user "Generating public API documentation with Doxygen")
+ # Convenience targets to build all the documentation flavors.