我无法通过 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/