Set output_formats["MAN"] to "NO", by default, as suggested at
http://www.scons.org/wiki/DoxygenBuilder#Note_added_by_Reinderien. Despite
what the Doxygen docs say, GENERATE_MAN is off by default, and a
browse of the source suggests that it's been that way since at least
2008 / Doxygen 1.5.7.
Add ".last_updated" targets to doxygen output directories, so that
doxygen isn't automatically considered up-to-date just because the
output directory exists.
- corrected basic dependencies (builds and 'scons -c' seem to work now)
- added support for output file EXTENSION override variables (HTML and MAN pages)
- TODOs: 1.) targets for MAN output don't work yet, 2.) more testing
Robert Lupton noted that you have to change the source paths if you keep your Doxyfile in a subdirectory and use relative paths.
I found that I had to do the same for the target path in the Doxyfile. (see after line 160)
The following code adds the tagfile to the target list. I added it in line 166:
# add the tag file if neccessary:
tagfile = data.get("GENERATE_TAGFILE", "")
if tagfile != "":
if not os.path.isabs(tagfile):
conf_dir = os.path.dirname(str(source[0]))
tagfile = os.path.join(conf_dir, tagfile)
targets.append(env.File(tagfile));
To add the html templates from the Doxyfile to the list of sources,
you need to apply Robert Lupton's change and add the following snippet in line 137:
# Add additional files to the list ouf source files:
def append_additional_source(option):
file = data.get(option, "")
if file != "":
if not os.path.isabs(file):
file = os.path.join(conf_dir, file)
if os.path.isfile(file):
sources.append(file)
append_additional_source("HTML_STYLESHEET")
append_additional_source("HTML_HEADER")
append_additional_source("HTML_FOOTER")
You can easily add dependencies on other output file templates by adding additional calls to append_additional_source().
__Addendum 18 July 2007__: I added some code to add tagfiles to the list of sources.
Since the tagfiles-option allows for equal-signs in the value, I had to change the parsing code a bit.
The code now also includes the other changes I proposed.
__Remark__: as of 2025, this is the oldest code version that can be documented.
The content is taken from an Achive.org snapshot from June 21, 2006
https://web.archive.org/web/20060621095023/http://www.scons.org/wiki/DoxygenBuilder
Based on the comments added 2010-03-07 by Russel Winder,
this code can be attributed to Matthew Nicolson
Improvements added by Dirk Reiners:
I added two (at least for me ;)) important features of doxygen:
variable substituion and hierarchical doxygen files.
Variable substituion allows doxygen to reference variables from the scons environment using $(VARNAME).
This is very useful for things like version numbers or for only having certain parts (as defined by scons)
included in the documentation without having to mess with doxygen files.
Hierarchical doxygen files just interpret the @INCLUDE key as an include.
I also had trouble with files that started with a key, I fixed that.
Note that I'm a python newbie, so there are probably more elegant ways to do some of the things I did.
Feel free to change them.
Hope it helps.