Doxygen is a useful tool to automatically generate documentation for code. It can produce beautiful documentation if the code comments are written in its custom format. Thankfully, even if this is not the case it can still produce documentation that can be useful for understanding a mass (or mess) of code written by someone else.
Doxygen uses a configuration file, typically named Doxyfile, to generate documentation. Doxygen ships with a GUI tool named Doxywizard that makes it easy to create a configuration file and generate documentation for the first time.
As an example, assume the code in a project has the following directory structure:
C: +---Foobar +---Code +---Docs
That is the project root directory is
C:\Foobar, source code directory is
C:\Foobar\Code and the documentation produced by Doxygen will reside in
To produce this, fill the fields in Doxywizard as follows:
In the Run tab choose Run Doxygen to generate the documentation. It will be produced in the format you chose: HTML, CHM, XML, RTF or many others.
It is a good idea to save the configuration to a file named Doxyfile in the project directory. Do this in the Doxywizard by choosing File → Save As. By having a configuration file around, the documentation can be updated whenever the code in the project changes. This can be done directly by invoking doxygen.exe in that directory or can be automatically invoked by your build tool.
To get started quickly, I have shared my Doxyfile for C++ and CUDA code here. Just look for
foobar in the file and replace with your project name and directories.