Specify Doxygen parameters through command line

(This is an alternative to the accepted answer - most likely above.)

My preferred solution is to use environmental variables in the config file. Let's take "QUIET" as an example: In the config file I replace

QUIET                  = NO

with

QUIET                  = $(DOXYGEN_QUIET)

I then call Doxygen as follows

DOXYGEN_QUIET=YES doxygen configfile

or

env DOXYGEN_QUIET=YES doxygen configfile

if used inside a (Bash) script. You could of course also export the variable DOXYGEN_QUIET so you don't have to type it for each run.

PS! I have a Bash script that run several Doxygen jobs, and it uses the standard -q option to run the jobs quietly by setting DOXYGEN_QUIET. I also set PROJECT_NAME using the same trick with an environmental variable.


As far as I know this is not possible: a doxygen build is configured through the configuration file or with the GUI (which is much easier than trying to remember command line option names). Typing doxygen --help at the command line and the documentation for the doxygen usage suggest that all the command line options do is set which configuration file to read (and allow the user to get layout files and the like).

One way to modify configuration options from the command line would be to append options to the configuration file using something like (untested):

echo "INPUT = some file" >> Doxyfile

This will append INPUT = some file to your Doxyfile and any earlier values of INPUT are ignored. If you want to append an item to INPUT you could use

echo "INPUT += some file" >> Doxyfile

Notice the +=. This respects INPUT values set earlier in the file.

Rather than appending to the configuration file you could always use sed to find and replace options.


Look at the answer for question 17 in the FAQ: http://www.doxygen.nl/manual/faq.html#faq_cmdline, repeated below for convenience:

Can I configure doxygen from the command line?

Not via command line options, but doxygen can read from stdin, so you can pipe things through it. Here's an example how to override an option in a configuration file from the command line (assuming a UNIX environment):

( cat Doxyfile ; echo "PROJECT_NUMBER=1.0" ) | doxygen -

For Windows the following would do the same:

( type Doxyfile & echo PROJECT_NUMBER=1.0 ) | doxygen.exe -

If multiple options with the same name are specified then doxygen will use the last one. To append to an existing option you can use the += operator.

Tags:

Bash

Doxygen