Take the 2-minute tour ×

Well I am creating a script to automatically generate documentation for my projects with Doxygen, which seems like an awesome tool.
What is not clear to me, is if the user can use specify directly parameters, such as project name, project description etc., by setting them besides command:

doxygen -g "parameter modification here"
doxygen Doxyfile

Any tips appreciated!

share|improve this question
add comment

2 Answers

up vote 12 down vote accepted

Look at the answer for question 17 in the FAQ: http://www.doxygen.org/faq.html, 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.

share|improve this answer
It comes down to rtfm then :-) It's kind of weird that you cannot directly pass options to the script. I'll consider this as answer since it has a slightly more thorough example. –  Potney Switters Jun 15 '12 at 9:30
add comment

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 configuraion file you could always use sed to find and replace options.

share|improve this answer
This what I ended up doing with sed. Doing text replacement e.g. sed -i 's/OPTIMIZE_OUTPUT_FOR_C = NO/OPTIMIZE_OUTPUT_FOR_C = YES/g' Doxyfile –  Potney Switters Jun 14 '12 at 13:13
add comment

Your Answer


