Search code examples
cmddoxygenpopen

Is it possible to wrap a Doxygen filter command in quotes?


I am trying to write a Doxygen file filter that lives in a subdirectory that works from Doxyfile on both Windows and Linux.

Doxyfile
/scripts
    myfilter

I seem to be unable to specify the path using a forward-slash on Windows unless it is quoted:

"scripts/myfilter"

However, trying to quote the command in Doxyfile does not work.

FILTER_PATTERNS        = *.glsl=""scripts/runpython" scripts/doxygen-glslfilter.py"

On Windows, you get an error that implies the quotes don't exist.

'scripts' is not recognized as an internal or external command, operable program or batch file.

Doxygen uses popen() to run these commands and will remove the wrapping quotes around the command, but it does not seem to remove all quotes.

popen() call:

https://github.com/doxygen/doxygen/blob/master/src/definition.cpp#L745

filter name quote strip:

https://github.com/doxygen/doxygen/blob/master/src/util.cpp#L2458

However, the result is the same as if there were no quotes.

Update

I was able to get command logging in Doxygen, and it appears the extra quotes are being stripped in an odd way. You can see how there is a space in front of the command.

Executing popen(` scripts/runpython scripts/doxygen-glslfilter.py "C:/dev/g3d/G3D10/data-files/shader/AlphaFilter.glsl"`)

Update

I submitted a bug report/feature request but I doubt it will be read.

Doxygen Bug Report


Solution

  • The issue was reported to the doxygen project, and they have provided a solution where any '/' in the command is replaced by '\' on Windows.

    https://bugzilla.gnome.org/show_bug.cgi?id=792846

    This was done to resolve a similar issue here: What is the QHG_LOCATION path relative to for doxygen?

    The pull request for the project on github here: https://github.com/doxygen/doxygen/pull/703