用doxygen记录配置宏 [英] Document a config macro with doxygen

查看:310
本文介绍了用doxygen记录配置宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用doxygen记录配置宏.该宏未在源代码中定义,但需要使用编译器定义设置进行定义.

I want to document a configuration macro with doxygen. That macro is not defined in source code but is required to be defined using compiler definition settings.

由于我没有定义,因此尝试了类似在doxygen手册中找到的以下内容(我将此代码段添加到了使用宏进行条件编译的标头中):

Since I have no definition I tried something like the following which I found in the doxygen manual (I added this snippet to the header that is using the macro for conditional compilation):

/*! \def MY_CONFIG_MACRO
    \brief Brief

    Details.
*/

但是,该文档未出现在生成的HTML文件中.知道为什么上面的方法行不通吗?如何在使用它的上下文中记录编译器定义的宏?

However that documentation does not appear in the generated HTML files. Any idea why the above doesn't work? How can I document a compiler defined macro in the context where it is used?

推荐答案

遇到了同样的问题,它的解决方法是这样的:

Got the very same problem, it was resolved like this:

在doxygen配置文件中,添加:

In the doxygen configuration file, add:

PREDEFINED = IN_DOXYGEN

在源代码中的某处添加:

Somewhere in the source code, add:

/*
  Exporting cmake compilation flags to doxygen,
  so they get documented.
*/
#ifdef IN_DOXYGEN
#define MY_CONFIG_MACRO
#endif /* IN_DOXYGEN */

然后正确获取了MY_CONFIG_MACRO的文档.

Then the documentation for MY_CONFIG_MACRO is picked up properly.

这篇关于用doxygen记录配置宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆