c++ - 无法在 C++ 项目上从 Meson 运行 Doxygen

标签 c++ configuration doxygen meson-build

我无法通过 Meson 的配置运行 Doxygen。

这是meson.build中的相关代码:

doxygen = find_program('doxygen')
...
run_target('docs', command : 'doxygen ' + meson.source_root() + '/Doxyfile')

成功找到doxygen可执行文件:

Program doxygen found: YES (/usr/bin/doxygen)

但是,启动时,我收到此错误消息:

[0/1] Running external command docs.
Could not execute command "doxygen /home/project/Doxyfile". File not found.
FAILED: meson-docs

从命令行手动运行它:

/usr/bin/doxygen /home/project/Doxyfile
doxygen /home/project/Doxyfile

我的 meson.build 配置有什么问题?

最佳答案

根据引用manual ,

command is a list containing the command to run and the arguments to pass to it. Each list item may be a string or a target

因此,在您的情况下,整个字符串被介子视为命令,即工具名称,而不是命令 + 参数。所以,试试这个:

run_target('docs', command : ['doxygen', meson.source_root() + '/Doxyfile'])

或者直接使用find_program()的结果会更好:

doxygen = find_program('doxygen', required : false)
if doxygen.found()
  message('Doxygen found')
  run_target('docs', command : [doxygen, meson.source_root() + '/Doxyfile'])    
else
  warning('Documentation disabled without doxygen')
endif

请注意,如果您想通过支持 Doxyfile.in 改进文档生成,请查看 custom_target()相反,例如 this .

关于c++ - 无法在 C++ 项目上从 Meson 运行 Doxygen,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52520146/

相关文章:

C++20 'familiar template' lambda : specifying an explicit argument in function pointer conversion

xml - Spring <sws :interceptors> to annotation based configuration

c# - 从 ASP.NET WebAPI 应用程序调用 Web 服务

python - 如何使用 doxygen 为所有 python 文件创建文档(和调用图)

c++ - 在多个线程 C++ 中启动相同的 shell 脚本

c++ - 问题产生应用程序

c - Doxygen 对待 main.c 与其他文件的方式不同

c++ - 标记覆盖的函数

c++ - 我错过了什么? GetLine 函数 (C++)

configuration - 构建预配置的 debian 软件包