summaryrefslogtreecommitdiff
path: root/doc/CMakeLists.txt
diff options
context:
space:
mode:
authorJohann Klähn <kljohann@gmail.com>2013-01-19 22:56:12 +0100
committerJohann Klähn <kljohann@gmail.com>2013-01-19 23:05:17 +0100
commit54c14f9770e86eca0312d3e5ec3bb201c484358f (patch)
tree6e216e6b81d341718c911910b9499884f2a3346c /doc/CMakeLists.txt
parentb66c19b1f8a6449af89154e75b2348ad41080c00 (diff)
downloadfork-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/CMakeLists.txt')
-rw-r--r--doc/CMakeLists.txt32
1 files changed, 22 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)
########################################################################