How to get Doxygen to expand macros from include files?

I have several multi-line macros defined in the macros.h file. In my doxyfile I have

ENABLE_PREPROCESSING = YES MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = NO PREDEFINED = EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = NO 

but Doxygen will still not extend macros in any source file that includes macros.h. I ran "doxygen -d Preprocessor doxyfile" to see the output of the preprocessor, and it displays messages such as:

 #include macros.h: not found or already included! skipping... 
0
source share
2 answers

You told your compiler about your inclusion path, but you did not say doxygen. Therefore, he tries to open "macros.h" and receives an error not found in the file.

You need to install INCLUDE_PATH correctly in your Doxyfile.

+3
source

@Ben: Did you really get INCLUDE_PATH to work?

I understand the theory. I set INCLUDE_PATH as explained (in both absolute and relative forms), but to no avail. I set INCLUDE_FILE_PATTERNS to * .h. However, when processing my .cpp files, Doxygen finds all the headers in the INPUT directory, but does not find the headers in my lib / subdirectory.

The only solutions found:

1) Create a symbolic link in the INPUT directory for each header in its lib / subdirectory. This is ugly and illogical.

2) Set the RECURSIVE label to YES. This is undesirable because now the entire contents of INPUT tests / subdirectory is added to the generated documentation.

I am inclined to believe that the functionality of INCLUDE_PATH is simply broken (at least in version 1.7.1 that I am running).

0
source

All Articles