tags:

views:

90

answers:

2

Hi

For a Qt/C++ project we will use doxygen to generate some documentation, therefore I'm searching for a "optimal" config file.

One thing that I was thinking about is that you have stuff like

OPTIMIZE_OUTPUT_FOR_C  = NO
OPTIMIZE_OUTPUT_JAVA   = NO
OPTIMIZE_FOR_FORTRAN   = NO
OPTIMIZE_OUTPUT_VHDL   = NO

But I can't find something like that for C++, and I'm not sure if I need anything like that for C++.

Is there a option like "OPTIMIZE_OUTPUT_FOR_C++"?

Thanks Johan

A: 

Optimise output for C will cover what you're looking for. In fact oddly it's more C++-oriented than C.

(Apparently this is no longer true - or I have a terrible memory)

Rushyo
How strange, but let's try it
Johan
This isn't consistent with what the Doxygen manual says about the `OPTIMIZE_OUTPUT_FOR_C` configuration option. For instance, it says that this will omit the list of all members (which makes sense for C, but not C++). Granted, the documentation may be wrong, but it makes me skeptical.
Dan Moulding
As I suspected, this is not true. I tried turning on `OPTIMIZE_OUTPUT_FOR_C` and it uses naming in the documentation that is *less* appropriate for C++. For instance, it changes a section heading from "Classes" to "Data Structures". This would be appropriate for C, not C++.
Dan Moulding
Hmm. Perhaps that's changed. It's been a while since I used it. I always remember setting optimise for C used to refer to structs as classes, which was a little bit silly.
Rushyo
+4  A: 

It seems to me that Doxygen is by default optimized for C++. From what I can tell, C++ was the first language that Doxygen was designed to be used with; it was supported as far back as the "Change Log" goes. Java support, on the other hand, was not added until version 1.2.5. The OPTIMIZE_OUTPUT_FOR_C option was also not added until 1.2.5, indicating that prior to 1.2.5, Doxygen was intended to be used more for C++, and less for C.

Without enabling any of the other OPTIMIZE_FOR_<X> options, Doxygen's output uses C++-style naming in the output. For instance, it will create a group header named "Classes" for listing all classes and structs. On the other hand, if OPTIMIZE_OUTPUT_FOR_C is turned on, that group header's name is changed to "Data Structures" (this makes sense since C doesn't have "classes").

So, if you want to optimize output for C++, I think the answer is just use the default optimization settings (i.e. don't turn on OPTIMIZE_OUTPUT_FOR_C or any of the other such options).

Dan Moulding