Search⌘ K
AI Features

Adding Doxygen to Our Project

Discover how to add Doxygen documentation generation to your C++ projects using CMake. Understand configuring Doxygen through CMake scripts, enabling HTML output, and leveraging source comments to produce clear, maintainable project documentation.

One of the most established and popular tools that can generate documentation from C++ sources is Doxygen. And when we say "established," we mean it: the first version was released by Dimitri van Heesch in October 1997. Since then, it has grown immensely, and it is actively supported by over 180 contributors to its repository.

Supported formats

Doxygen can produce documentation in the following formats:

  • HyperText Markup Language (HTML)

  • Rich Text Format (RTF)

  • Portable Document Format (PDF)

  • Lamport’s TeX (LaTeX)

  • PostScript (PS)

  • Unix manual (man pages)

  • Microsoft Compiled HTML Help (CHM)

If we decorate our code with comments providing additional information in the format specified by Doxygen, it will be parsed to enrich the output file. What's more, the code structure will be analyzed to produce helpful charts and diagrams. The latter is optional, as it requires an external Graphviz tool.

User-generated documentation

The developer should first answer the following question: "Do users of the project just get the documentation, or will they generate it themselves (perhaps when they build ...