如何在 Doxygen 配置中使用相对路径名

Wef*_*fel 6 doxygen config path relative-path

我的 doxygen 在我的 /utils 目录中,而我的源代码在 root( /code_with_doxygen) 的另一个目录中,我怎么能为此创建一个相对路径名,因为它位于一个存储库中,该存储库将位于其他计算机的不同位置。我无法记录整个根目录,因为我也不想/code_without_doxygen构建目录。

项目树如下所示:

root
    utils
    code
        code_with_doxygen
        code_without_doxygen
    documentation
Run Code Online (Sandbox Code Playgroud)

现在我有设置,但这似乎不起作用:

FULL_PATH_NAMES        = YES
STRIP_FROM_PATH        = ../
Run Code Online (Sandbox Code Playgroud)

我似乎无法弄清楚:doxygen 生成的文档中的相对文件路径

gmu*_*mug 4

相对路径取决于您执行 doxygen 的目录。例如,如果您有以下项目树:

+ project_root
     + documentation
         + config
             - doxyfile
         + pictures
         + output
         - run_doxygen.bat
     + code
         + code_with_doxygen
         + code_without_doxygen
Run Code Online (Sandbox Code Playgroud)

在这种情况下,所有相对路径都位于文件夹“documentation”中,因为您正在从此文件夹运行脚本“run_doxygen.bat”。所以你可以将INPUT“doxyfile”中的标签设置为

INPUT = ./../code
Run Code Online (Sandbox Code Playgroud)

以及OUTPUT_DIRECTORYdoxyfile 中的标记

OUTPUT_DIRECTORY = ./output
Run Code Online (Sandbox Code Playgroud)

误导性的是,即使 doxyfile 位于子文件夹“config”中,路径也不是相对于 doxyfile 的位置,因为路径是相对于调用 doxygen 的位置。在本例中,它是文件夹“documentation”,因为这是调用 doxygen 的脚本的位置。