简体   繁体   English

如何获得Doxygen从包含文件扩展宏?

[英]How do I get Doxygen to expand macros from include files?

I have a number of multiline macros defined in a file called macros.h. 我在名为macros.h的文件中定义了许多多行宏。 In my doxyfile, I've got 在我的doxyfile中,我有

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. 但是Doxygen仍然不会在任何包含macros.h的源文件中扩展宏。 I ran "doxygen -d Preprocessor doxyfile" to see the output of the preprocessor, and it outputs messages like: 我运行“ doxygen -d预处理程序doxyfile”以查看预处理程序的输出,并且它输出如下消息:

#include macros.h: not found or already included! skipping...

You've told your compiler about your include path, but you haven't told doxygen. 您已经告知编译器您的包含路径,但是您没有告诉doxygen。 So it tries to open "macros.h" and gets a file-not-found error. 因此,它尝试打开“ macros.h”并得到一个找不到文件的错误。

You need to properly set INCLUDE_PATH in your Doxyfile. 您需要在Doxyfile中正确设置INCLUDE_PATH

@Ben: Have you actually gotten INCLUDE_PATH to work? @Ben:您实际上有INCLUDE_PATH上班吗?

I understand the theory. 我了解理论。 I have set up the INCLUDE_PATH as explained (in both absolute and relative forms) but to no avail. 我已经按照说明(以绝对形式和相对形式)设置了INCLUDE_PATH,但无济于事。 I have set INCLUDE_FILE_PATTERNS to *.h. 我已将INCLUDE_FILE_PATTERNS设置为* .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. 但是,在处理我的.cpp文件时,Doxygen会在INPUT目录中找到所有标头,但在lib /子目录中却找不到任何标头。

The only solutions I have found are: 我发现的唯一解决方案是:

1) Create a symbolic link within the INPUT directory to each header in its lib/ subdirectory. 1)在INPUT目录中创建一个指向其lib /子目录中每个标题的符号链接。 This is ugly and ungeneralizable. 这是丑陋且无法概括的。

2) Set the RECURSIVE tag to YES. 2)将RECURSIVE标签设为YES。 This is undesirable because now the entire contents INPUT's tests/ subdirectory get added to the generated documentation. 这是不希望的,因为现在将INPUT的tests /子目录的全部内容添加到了生成的文档中。

I am inclined to believe that INCLUDE_PATH functionality is simply broken (at least in version 1.7.1 that I am running). 我倾向于认为INCLUDE_PATH功能已被破坏(至少在我正在运行的1.7.1版本中)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM