Silicomancer Silicomancer - 1 year ago 123
C Question

Document a config macro with doxygen

I want to document a configuration macro with doxygen. That macro is not defined in source code but is required to be defined using compiler definition settings.

Since I have no definition I tried something like the following which I found in the doxygen manual (I added this snippet to the header that is using the macro for conditional compilation):

\brief Brief


However that documentation does not appear in the generated HTML files. Any idea why the above doesn't work? How can I document a compiler defined macro in the context where it is used?

Answer Source

Got the very same problem, it was resolved like this:

In the doxygen configuration file, add:


Somewhere in the source code, add:

  Exporting cmake compilation flags to doxygen,
  so they get documented.
#endif /* IN_DOXYGEN */

Then the documentation for MY_CONFIG_MACRO is picked up properly.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download