问题描述
我正在尝试使用doxygen为我编写的某些matlab类生成文档.我正在使用 doxygen-matlab 软件包,包括一个perl脚本,可将matlab .m文件融合为c ++样式的注释文件,以便doxygen可以读取它们.
I am trying to use doxygen to generate documentation for some matlab classes I have written. I am using the doxygen-matlab package, which includes a perl script to kludge matlab .m files into c++ style commented files, so that doxygen can read them.
在我的doxyfile中,我已经设置了(根据说明)
In my doxyfile, I have set (according to the instructions)
FILTER_PATTERNS = *m=C:/doxygenMatlab/m2cpp.pl
但是,当代码运行时,而不是在输入文件上运行脚本,它似乎只是使用.pl的默认Windows设置打开脚本.
However, when the code runs, rather than running the script on the input files, it appears to just open the script using whatever the default windows setting for .pl is.
IE,如果我将.pl与记事本关联,则对于doxygen试图解析的每个输入文件,记事本都会打开一次脚本.如果我将.pl与perl.exe关联,脚本将运行并抛出no参数错误
IE, if I associate .pl with notepad, the script is opened by notepad once for each input file doxygen is trying to parse. If I associate .pl with perl.exe, the script runs and throws the no argument error
doxygen文档说
The doxygen documentation says
Doxygen will invoke the filter program by executing (via popen()) the command <filter> <input-file>
所以我想知道popen()和我可以修复的Windows是否存在问题.
So I am wondering if there is some problem with popen() and windows that I could fix.
推荐答案
我尝试使用Windows命令提示符("cmd")重现该错误,并注意到以下内容:
I tried to reproduce the error using the Windows command prompt ("cmd") and noticed the following:
- 如果您调用"perl m2cpp.pl",则会得到错误-1,因为您没有指定要转换为cpp文件的m文件.
- 如果调用"perl m2cpp.pl mfile",并且mfile的路径包含空格,则会出现错误1.
- 将mfile移到不包含空格的位置后,得到了所需的输出.
现在回到Doxygen.我尝试了您的建议,Fabrice,没有任何运气.我阅读了doxygen帮助,发现仅当FILTER_PATTERNS为空时才读取和使用INPUT_FILTER变量.
Now back to Doxygen. I tried what you suggested, Fabrice, without any luck. I read the doxygen help and found out that the INPUT_FILTER variable is only read and used if FILTER_PATTERNS is empty.
因此,我现在使用INPUT_FILTER ="C:\ Programme \ MATLAB \ R2009a \ sys \ perl \ win32 \ bin \ perl U:\ doxygen_matlab \ m2cpp.pl"和一个空的FILTER_PATTERNS变量.使用此配置,您甚至可以将PERL_PATH变量保留为空.而且,包含空格的文件名似乎没有问题.
Therefore, I now use INPUT_FILTER = "C:\Programme\MATLAB\R2009a\sys\perl\win32\bin\perl U:\doxygen_matlab\m2cpp.pl" and an empty FILTER_PATTERNS variable. With this configuration, you can even leave the PERL_PATH variable empty. Moreover, there seems to be no issues with file names that contain spaces.
不幸的是,所有文件都使用上述配置进行了解析,而不仅仅是m文件.但是,将FILTER_PATTERNS设置为* .m = C:\ Programme \ MATLAB \ R2009a \ sys \ perl \ win32 \ bin \ perl U:\ doxygen_matlab \ m2cpp.pl无效,因为doxygen自动添加了过滤后的mfile的名称.并将命令解释为perl"m2cpp.pl mfile".当然,文件"m2cpp.pl mfile"不存在,因为它们是两个文件.
Unfortunately, all files are parsed with the above configuration, not only m-files. However, setting FILTER_PATTERNS to something like *.m=C:\Programme\MATLAB\R2009a\sys\perl\win32\bin\perl U:\doxygen_matlab\m2cpp.pl does not work because doxygen automatically adds the name of the filtered mfile and interprets the command as perl "m2cpp.pl mfile". Of course, the file "m2cpp.pl mfile" does not exist, because these are two files.
也许您可以找到解决此问题的方法.同时,我建议您采用上述解决方法,并将C文件远离包含m文件的文件夹.
Maybe you can find a solution to this problem. In the meantime, I suggest the workaround above and that you keep your C-files away from the folder that contains the m-files.
这篇关于在Windows XP上使用Doxygen 1.6.3的输入过滤器出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!