Keep Doxyfile in sync with Autoconf

Generating Doxygen configuration file – Doxyfile from Autoconf is simple and helps to avoid duplication of version numbers, input and output directories and packages names. Doxyfile can be generated like Makefiles from Doxyfile.in by configure script.

First generate Doxyfile skeleton like usual:

$ doxygen -g Doxyfile.in

Then open Doxyfile.in in $EDITOR and set following variables:

PROJECT_NAME           = @PACKAGE_NAME@
PROJECT_NUMBER         = @VERSION@

INPUT                  = @top_srcdir@
OUTPUT_DIRECTORY       = @top_builddir@/doc

RECURSIVE              = YES

Finally add Doxyfile to configure.ac (or .in if you prefer .in convention):

AC_CONFIG_FILES([Makefile
                 ...
                 Doxyfile
                ])
AC_OUTPUT

Recreate configure script and run it (just run “make” and it will do all the magic for you).

Next time you change version, package name or anything else in Autoconf Doxyfile will be recreated with updated values.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>