Patrick Kelly
Patrick Kelly

Reputation: 1381

How can I display Doxygen configuration variables?

I am trying to display values stored in Doxygen configuration variables. A simple example is the "PROJECT_NAME" variable in the standard Doxyfile configuration file. How can I display this at an arbitrary location in the code?

I've set up a file called main.dox with the following contents:

/*!  \mainpage Main Page

- @PROJECT_NAME
- @PROJECT_NAME
- $PROJECT_NAME
- ${PROJECT_NAME}

 */

The value for PROJECT_NAME is set to "MY DOCS" in the standard Doxyfile configuration. The title displays correctly at the top of the documentation. On the main page, however, the code above generates the following:

*
*
* $PROJECT_NAME
* ${PROJECT_NAME}

How can I get it to display MY DOCS in the generated output?

Upvotes: 1

Views: 826

Answers (1)

Nicol Bolas
Nicol Bolas

Reputation: 473182

You don't. Doxygen has no way to inject the text of configuration variables into arbitrary points in the code.

You can however write a custom command, an alias/macro that can be used to repeat text in various location. Granted, you'll have to repeat the text of your project name, but it'll be repeated in the configuration file:

PROJECT_NAME = Project Name
ALIASES += projname="Project Name"

In your documentation comments, you can now use \projname or @projname.

Upvotes: 1

Related Questions