gsamaras gsamaras - 1 month ago 8
C++ Question

Make doxygen doxument the #ifdef parts too

As suggested here, I have some parts in my code, that are enabled by a compilation flag.

For example I have this piece of code:

#ifdef MYPROJ_HAS_BOOST
...
#endif


Doxygen will leave them out, because they are omitted, since
MYPROJ_HAS_BOOST
is not defined. I solved it, with adding a
#define MYPROJ_HAS_BOOST
.

However this is not nice, because in the future (I am planning to extend the project), when the time comes to re-generate my documentation, maybe I will have forgotten about this.

Is there any way to say to Doxygen (ideally via doxywizard) to take into account these parts of my code too?

Answer

I think you just need to disable preprocessing at all by setting ENABLE_PREPROCESSING to NO in doxygen configuration file.

In doxywizard go to Expert -> Preprocessor and you will find ENABLE_PREPROCESSING. Just uncheck it to set it to NO.

More information about preprocessing in doxygen can be found in documentation here.