Environment Variable for DOT path in Doxygen for Windows
Asked Answered
G

2

8

My team has developers who are using Windows and Linux. We store Doxyfiles in our version control system. Because of that we leave the DOT_PATH blank, and when I pull from the repo to do a code review I always need to modify the DOT_PATH locally. Can I somehow modify the PATH environment variable in windows such that Doxygen will always find Dot when DOT_PATH is empty? The documentation makes it sound like I should be able to:

# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
# This tag requires that the tag HAVE_DOT is set to YES.

DOT_PATH               =

I edited the PATH variable for my windows account and put in my dot path, C:\Program Files (x86)\Graphviz2.30\bin\, I see that path when I type path in a command shell, but Doxygen doesn't seem to see it.

Gunpoint answered 2/5, 2017 at 13:1 Comment(1)
Seen the answer from Stan. I wonder with which version of doxygen you have a problem (and if it is still persistent with the current doxygen version). I have the graphviz path in my PATH as well (although for version 2.38) and have no problems.Siana
M
7

We had a similar issue recently for PLANTUML with doxygen, see below for a solution.

In the configuration file (Doxyfile) checked in, use an environment variable, as in:

PLANTUML_JAR_PATH      = $(PLANTUML_JAR_PATH)

In each developer environment, define the variable with the proper path, depending on platform and specific machines.

In my case for linux, for example:

malff@linux-8edv:GIT_TRUNK> uname -a
Linux linux-8edv 4.1.39-53-default #1 SMP PREEMPT Thu Mar 30 06:44:23 UTC 2017 (56cc5a0) x86_64 x86_64 x86_64 GNU/Linux
malff@linux-8edv:GIT_TRUNK> env | grep PLANTUML_JAR_PATH
PLANTUML_JAR_PATH=/home/malff/plantuml/plantuml.8053.jar

Not tested, but I think something similar should work for DOT_PATH.

Medicare answered 4/5, 2017 at 15:32 Comment(1)
That did exactly what I needed.Gunpoint
L
2

You can try to use the full path in the short name notation (also known as 8.3 or DOS). It looks like this:

C:\PROGRA~1\COMMON~1\graphviz\bin\

You can find out all short names in the path using this shell script (you may name it shortpath.cmd):

@echo %~s1

The script accepts a single argument which will be translated into the short notation, so run it like this:

shortpath.cmd "C:\Program Files\Common Files\graphviz\bin"

Replace the argument with actual location of your copy of graphviz. Credits go to this answer.

Lumen answered 11/1, 2020 at 20:27 Comment(11)
Which version of doxygen does gives the problems so you need the short name notation? Please show the test setup from your doxygen configuration file. Probably just placing quotes around it is sufficient.Siana
@albert, this is an answer for the question, where OP specified a path with longnames and without quotes. If you think that quotes around the path should help, you can post your answer. From my exprience with graphviz 2.38 on Windows 7 - if a long path is used withing quotes the process hangs with 100% CPU consumption. This is why I posted the alternative method, which works for me.Lumen
A solution with a short name overcomes the problem with the spaces but I didn't see (recently) any problems with doxygen when using the dot executable direct from the path or by specifying the DOT_PATH withing quotes. For readability I think it is better to have the long names (due to PROGRA~1and PROGRA~2 for Program Files and Program Files (x86)). Looks like not all windows systems have files with 8.3 names (I didn't see them on my system D: drive, they are on my C: drive).Siana
Reference for the 8.3 not present: answers.microsoft.com/en-us/windows/forum/all/…Siana
@albert, I've changed my wording to underline that my solution is not the only one.Lumen
How does this answer my original question?Gunpoint
@Nick, my suggestion is to try shortname notation in the path variable.Lumen
OK, I get it now. I'll give that a try next time I am setting up Doxygen on a new project.Gunpoint
@Nick, one more thing: do you set the path on the global system level or in a specific (probably separate) shell window? The latter variant will not take effect in other process trees.Lumen
@Nick, did you do it in the same shell window or cmd-file where you run graphviz afterwards? Persistent system-wide change of the path is made via advanced system settings - java.com/en/download/help/path.xmlLumen
@Lumen I set it through advanced system settings the same way the page you linked describes.Gunpoint

© 2022 - 2024 — McMap. All rights reserved.