To register a new account on this wiki, contact us

Configuring and Using Doxygen

From FSCI Wiki
Revision as of 16:15, 18 January 2011 by Missing actor (talk)
Jump to navigation Jump to search

Introduction

Doxygen is a documentation system for C++, C, Java, Objective-C, Python, IDL (Corba and Microsoft flavors), Fortran, VHDL, PHP, C#, and to some extent D.

It can help in three ways:

  1. It can generate an on-line documentation browser (in HTML) and/or an off-line reference manual (in $\mbox{\LaTeX}$) from a set of documented source files. 
     There is also support for generating output in  PostScript, hyperlinked PDF, compressed HTML, and Unix man pages. The documentation is extracted directly from the sources, which makes it much easier to keep the documentation consistent with the source code.
  2. We can configure doxygen to extract the code structure from undocumented source files. This is very useful to quickly find our way in large source distributions. 
     We can also visualize the relations between the various elements by means of include dependency graphs, inheritance diagrams, and collaboration diagrams, which are all generated automatically.
  3. It boosts the reading and understanding of the code due to visualization. 

Previously I thought that we can edit the code using doxygen. But we can not edit the code but can just browse the code using doxygen, which is the disadvantage of using the doxygen.


Using and configuring the Doxygen

1. Firstly we have to install package doxygen.

2. Then go to the directory where source files are kept. For example, in our case we go to the <>/src/ directory.

3. Run command doxygen -g which will generate the file "Doxyfile"

4. Now we can configure the doxygen as per our need using this "Doxyfile".

For Example,

  If we set the EXTRACT_ALL = YES then, it will extract documentation even from those elements we haven't yet commented.
  If we set INLINE_SOURCE = YES then it will extract the relevant parts of the source and associate them with our description.
  If we set HAVE_DOT = YES then it will use Graphviz for class and collaboration diagrams.
  If we set CALL_GRAPH = YES it will generate a dependency graph for functions and methods.
  

5. When you are done with the editing the Doxyfile, run the command

         doxygen Doxyfile

6. This will create the all documentation and diagrams as per the Doxyfile.

7. Now you can browse the code by going to the html directory generated in the source files' directory and opening index.html in browser.

References

http://www-scf.usc.edu/~peterchd/doxygen/

http://www.stack.nl/~dimitri/doxygen/manual.html