Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to configure Doxygen for C++ code

📅 2014-Jun-18 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

If you do not use an IDE, then Doxygen is a heaven-send for understanding and working with a huge C++ codebase. To make your life easier, you can configure Doxygen to give you as much information as possible in its documentation. Here are the settings I use for C++ code:

Doxywizard

If the project does not have a Doxyfile configuration file, then using Doxywizard is a convenient way to generate this file. I like to use its Wizard mode to quickly set the most important settings.

Configuration file

In the configuration file, I like to enable a few more options:

BUILTIN_STL_SUPPORT = YES

# Show private members of class
EXTRACT_PRIVATE = YES

# Show static members of class
EXTRACT_STATIC = YES

# Show members of anonymous namespace
EXTRACT_ANON_NSPACES = YES

# Show which header file to include to use this class or member
SHOW_GROUPED_MEMB_INC  = YES

# Add all the header and source file extensions used
FILE_PATTERNS = *.cpp *.h *.hpp

# Function source code shown inline
INLINE_SOURCES = YES

# Show all functions that reference current function
REFERENCED_BY_RELATION = YES

# Show all functions referenced by current function
REFERENCES_RELATION = YES

# Generate class diagrams for base class
CLASS_DIAGRAMS = YES

# Number of threads to use for DOT
DOT_NUM_THREADS = 4

# Use UML notation for class diagrams
UML_LOOK = YES

# Show all members in UML class
UML_LIMIT_NUM_FIELDS = 0

# Show relationship for templates in graphs
TEMPLATE_RELATIONS = YES

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.

Tried with: Doxygen 1.8.6 and Ubuntu 14.04