1

I am using doxygen 1.8.20

relevant config:

INPUT                  = @CMAKE_CURRENT_SOURCE_DIR@
ENABLE_PREPROCESSING   = YES
MACRO_EXPANSION        = YES
EXPAND_ONLY_PREDEF     = NO
SEARCH_INCLUDES        = YES
INCLUDE_PATH           = @CMAKE_CURRENT_SOURCE_DIR@/../include\
                         @CMAKE_CURRENT_SOURCE_DIR@/include\  
                         @CMAKE_CURRENT_SOURCE_DIR@/src
INCLUDE_FILE_PATTERNS  =
PREDEFINED             =
EXPAND_AS_DEFINED      = 
SKIP_FUNCTION_MACROS   = NO

Defined macros:

#define BEGIN_NS(NS) namespace NS {
#define END_NS(NS) /* NS */ }

Macro usage:

BEGIN_NS(xyz::core)

class X { ... };

END_NS(xyz::core)
  • No namespaces generated in docs
  • class X page shows no namespace of the class X
  • many warnings like this: warning: Found ';' while parsing initializer list! (doxygen could be confused by a macro call without semicolon)
  • function-macros calls are documented as function definitions instead of being expanded and documented correcly

** EDIT **

Results of doxygen -x

# Difference with default Doxyfile 1.8.20
PROJECT_NAME           = "XXXX Library"
OUTPUT_DIRECTORY       = project/../build/docs
TOC_INCLUDE_HEADINGS   = 0
EXTRACT_ALL            = YES
EXTRACT_PRIVATE        = YES
EXTRACT_PACKAGE        = YES
EXTRACT_STATIC         = YES
WARN_IF_UNDOCUMENTED   = NO
INPUT                  = project
FILE_PATTERNS          = *.c \
                         *.cc \
                         *.cxx \
                         *.cpp \
                         *.c++ \
                         *.java \
                         *.ii \
                         *.ixx \
                         *.ipp \
                         *.i++ \
                         *.inl \
                         *.idl \
                         *.ddl \
                         *.odl \
                         *.h \
                         *.hh \
                         *.hxx \
                         *.hpp \
                         *.h++ \
                         *.cs \
                         *.d \
                         *.php \
                         *.php4 \
                         *.php5 \
                         *.phtml \
                         *.inc \
                         *.m \
                         *.markdown \
                         *.md \
                         *.mm \
                         *.dox \
                         *.py \
                         *.pyw \
                         *.f90 \
                         *.f95 \
                         *.f03 \
                         *.f08 \
                         *.f \
                         *.for \
                         *.tcl \
                         *.vhd \
                         *.vhdl \
                         *.ucf \
                         *.qsf
RECURSIVE              = YES
VERBATIM_HEADERS       = NO
MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
GENERATE_LATEX         = NO
LATEX_CMD_NAME         = latex
GENERATE_XML           = YES
MACRO_EXPANSION        = YES
INCLUDE_PATH           = project
SKIP_FUNCTION_MACROS   = NO
HAVE_DOT               = YES
mnesarco
  • 2,619
  • 23
  • 31
  • When using it is easy to give the command `doxygen -x` so you get the differences between the standard doxygen settings and the settings used, please post this list. Furthermore please create a small complete example so we can try to reproduce the problems. – albert Nov 23 '20 at 14:40

2 Answers2

0

I used the following setup equal to yours:

Settings:

# Difference with default Doxyfile 1.8.20
PROJECT_NAME           = "XXXX Library"
TOC_INCLUDE_HEADINGS   = 0
EXTRACT_ALL            = YES
EXTRACT_PRIVATE        = YES
EXTRACT_PACKAGE        = YES
EXTRACT_STATIC         = YES
WARN_IF_UNDOCUMENTED   = NO
VERBATIM_HEADERS       = NO
MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
GENERATE_LATEX         = NO
GENERATE_XML           = YES
MACRO_EXPANSION        = YES
INCLUDE_PATH           = .
SKIP_FUNCTION_MACROS   = NO
HAVE_DOT               = YES
QUIET=YES

file aa.h

/// \file
#define BEGIN_NS(NS) namespace NS {
#define END_NS(NS) /* NS */ }

BEGIN_NS(xyz::core)

class X { ... };

END_NS(xyz::core)

file bb.h

/// \file
#define BEGIN_NS1(NS1) namespace NS1 {
#define END_NS1(NS1) /* NS1 */ }

and file bb1.h

/// \file

#include "bb.h"

BEGIN_NS1(xyz1::core1)

class X1 { ... };

END_NS1(xyz1::core1)

and I get as result:

enter image description here

we see that here the class is missing, in the current master (1.9.0 (4e75d77f60bd173019247177686376ce36ace90b)) the class is present:

enter image description here

Is this what you meant or did I miss something?

albert
  • 8,285
  • 3
  • 19
  • 32
0

I had the same problem and solved it by adding the input directories also in the INCLUDE_PATH. For some reason, INPUT directories do not seem to be used as INCLUDE_PATH on doxygen 1.9.6. Maybe there's a problem for you too here (@CMAKE_CURRENT_SOURCE_DIR@ ?)

brahmin
  • 568
  • 1
  • 5
  • 17