diff options
author | Johann Klähn <kljohann@gmail.com> | 2013-01-19 22:56:12 +0100 |
---|---|---|
committer | Johann Klähn <kljohann@gmail.com> | 2013-01-19 23:05:17 +0100 |
commit | 54c14f9770e86eca0312d3e5ec3bb201c484358f (patch) | |
tree | 6e216e6b81d341718c911910b9499884f2a3346c /doc | |
parent | b66c19b1f8a6449af89154e75b2348ad41080c00 (diff) | |
download | fork-ledger-54c14f9770e86eca0312d3e5ec3bb201c484358f.tar.gz fork-ledger-54c14f9770e86eca0312d3e5ec3bb201c484358f.tar.bz2 fork-ledger-54c14f9770e86eca0312d3e5ec3bb201c484358f.zip |
improve doxygen build logic
Doxygen will only be called when the 'doc' target is built
and one of its input files has changed.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/CMakeLists.txt | 32 | ||||
-rw-r--r-- | doc/Doxyfile.in | 2 |
2 files changed, 24 insertions, 10 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 7154be70..6753b3a8 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,3 +1,13 @@ +# The following will be generated or updated… +# …for every build (target 'doc.auto'): +# • user guide and man pages: if BUILD_DOCS is set +# • HTML versions of the above: if BUILD_DOCS and BUILD_WEB_DOCS are set +# +# …only when the 'doc' target is built explicitly: +# • Doxygen / reference documentation: if USE_DOXYGEN is set + +######################################################################## + if (USE_DOXYGEN) find_package(Doxygen) if(NOT DOXYGEN_FOUND) @@ -5,22 +15,23 @@ if (USE_DOXYGEN) endif() configure_file(Doxyfile.in Doxyfile @ONLY) + + # see INPUT/FILE_PATTERNS in Doxyfile.in + file(GLOB doxygen_input_files ${CMAKE_SOURCE_DIR}/src/*.h) + add_custom_command(OUTPUT html/index.html COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile - DEPENDS Doxyfile - COMMENT "Building doxygen documentation") - add_custom_target(doxygen - COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile - DEPENDS Doxyfile + DEPENDS Doxyfile ${doxygen_input_files} COMMENT "Building doxygen documentation") - message("NOTE: Doxygen documentation will be built once. Use target doxygen to update.") - list(APPEND ledger_doc_files html/index.html) -endif(USE_DOXYGEN) + add_custom_target(doc.doxygen DEPENDS html/index.html) +else() + add_custom_target(doc.doxygen) +endif() ######################################################################## if(NOT BUILD_DOCS) - add_custom_target(doc ALL DEPENDS ${ledger_doc_files}) + add_custom_target(doc DEPENDS doc.doxygen) return() endif() @@ -77,7 +88,8 @@ endif(BUILD_WEB_DOCS) ######################################################################## -add_custom_target(doc ALL DEPENDS ${ledger_doc_files}) +add_custom_target(doc.auto ALL DEPENDS ${ledger_doc_files}) +add_custom_target(doc DEPENDS doc.auto doc.doxygen) ######################################################################## diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index ff08c0f1..e340d84a 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -679,6 +679,7 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. +# please update dependencies in CMakeList.txt if you change this INPUT = @PROJECT_SOURCE_DIR@/src # This tag can be used to specify the character encoding of the source files @@ -697,6 +698,7 @@ INPUT_ENCODING = UTF-8 # *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py # *.f90 *.f *.for *.vhd *.vhdl +# please update dependencies in CMakeList.txt if you change this FILE_PATTERNS = *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories |