【问题标题】:Combine docs of libraries with overlapping postfix将库的文档与重叠的后缀结合起来
【发布时间】:2021-04-06 09:44:22
【问题描述】:

我想合并两个库的文档:BarMyBar。但是,这会导致重叠路径出现奇怪的问题。

考虑这个项目:

Doxyfile
Bar/config.h
MyBar/config.h

Doxyfile

INPUT = Bar MyBar

Bar/config.h:

/**
Lorem ipsum

\file Bar/config.h
*/

/**
Some bar lib.
*/
namespace Bar {

} // namespace Bar

MyBar/config.h:

/**
Lorem ipsum

\file MyBar/config.h
*/

#include <Bar/config.h>

/**
Some other library
*/
namespace MyBar {

} // namespace MyBar

使用 doxygen 1.9.1 构建会给出以下警告:

Bar/config.h:4: warning: the name 'Bar/config.h' supplied as the argument in the \file statement matches the following input files:
   /myprojectdir/Bar/config.h
   /myprojectdir/MyBar/config.h
Please use a more specific name by including a (larger) part of the path!

我真的不知道如何解决这个问题:没有更大的路径要指定(相对意义上)。

【问题讨论】:

    标签: doxygen


    【解决方案1】:

    \file 中目录名称的使用是潜在的问题来源。 当文件的文档块位于文件本身时,有两种解决方案:

    1. 使用不带文件名的\file 命令
    2. 在没有目录的情况下使用\file 命令

    我个人会选择第一个解决方案,因为在重命名文件的情况下,这也不必使用 \file 命令完成。

    【讨论】:

    • 虽然这解决了这个例子,但在我的生产代码中我得到了/myinclude/QPot/config.h:4: warning: the name '/myinclude/QPot/config.h' supplied as the argument in the \file statement matches the following input files: /myinclude/QPot/config.h Please use a more specific name by including a (larger) part of the path!。你懂吗?请注意,我使用\file,而不是到处使用参数,并且我无法在最小示例中重现它。
    • 我是否正确理解您有 1 个备选方案?有点奇怪,我得看看为什么会发生这种情况(小例子会很感激,你的代码是否有利于我什么时候找不到它?)。
    • 这确实是我感到困惑的原因。就像我说的那样,我没有设法获得最小的复制器(即它在没有警告的情况下运行)。但是,我的代码是 100% 开源的。给出警告的库在这里 github.com/tdegeus/GMatElastoPlasticQPot 。包含此库 github.com/tdegeus/QPot 失败。请注意,这还包括github.com/tdegeus/GMatTensor
    • 我刚刚意识到我应该指定文档“QPot”本身构建时没有任何错误或警告。只是当我将它们与“GmatElastoPlasticQPot”一起构建时,才会发生警告(或更多错误),似乎对于具有相同名称的文件和共享结尾的目录。例如。对于“*QPot/version.hpp”
    • 当我理解正确时,您尝试组合 3 个库/存储库。您使用的 doxygen 设置是什么? (即doxygen -x 的输出。使用简单的 Doxyfile 我没有看到问题)可能您还应该查看标记文件的可能性,即GENERATE_TAGFILETAGFILES
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-07-10
    • 2014-08-07
    • 1970-01-01
    • 2011-01-02
    • 1970-01-01
    • 1970-01-01
    • 2012-08-18
    相关资源
    最近更新 更多