0

I have a number of multiline macros defined in a file called macros.h. In my doxyfile, I've got

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

yet Doxygen still will not expand the macros in any source file that includes macros.h. I ran "doxygen -d Preprocessor doxyfile" to see the output of the preprocessor, and it outputs messages like:

#include macros.h: not found or already included! skipping...
May Oakes
  • 4,359
  • 5
  • 44
  • 51

2 Answers2

3

You've told your compiler about your include path, but you haven't told doxygen. So it tries to open "macros.h" and gets a file-not-found error.

You need to properly set INCLUDE_PATH in your Doxyfile.

albert
  • 8,285
  • 3
  • 19
  • 32
Ben Voigt
  • 277,958
  • 43
  • 419
  • 720
1

@Ben: Have you actually gotten INCLUDE_PATH to work?

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

The only solutions I have found are:

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

2) Set the RECURSIVE tag to YES. This is undesirable because now the entire contents INPUT's tests/ subdirectory get added to the generated documentation.

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

John Yates
  • 1,027
  • 1
  • 7
  • 18
  • 1
    I'm a _tiny_ bit late to the party here, but setting recursive to YES can be OK if you then set `EXCLUDE_PATTERNS = test/*`. No more "tests" subdirectory ending up in your documentation. – Chris Kitching May 27 '18 at 08:30