Skip to content

Commit 2800b82

Browse files
committed
issue #10987 Doxygen 1.11.0 for macOS reports 'sh: latex: command not found'
- Renamed EXTERNAL_TOOL_PATHS to EXTERNAL_TOOL_PATH - Prepend directories to PATH instead of appending them.
1 parent 269d60d commit 2800b82

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

src/config.xml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,16 +1343,23 @@ FILE_VERSION_FILTER = "cleartool desc -fmt \%Vn"
13431343
]]>
13441344
</docs>
13451345
</option>
1346-
<option type='list' id='EXTERNAL_TOOL_PATHS' format='dir' defval=''>
1346+
<option type='list' id='EXTERNAL_TOOL_PATH' format='dir' defval=''>
13471347
<docs>
13481348
<![CDATA[
1349-
The \c EXTERNAL_TOOL_PATHS tag can be used to extend the search path (PATH environment variable)
1350-
so that external tools such as \c latex and \c gs can be found.
1349+
The \c EXTERNAL_TOOL_PATH tag can be used to extend the search path (PATH environment variable)
1350+
so that external tools such as \c latex and \c gs can be found.
1351+
\note Directories specified with EXTERNAL_TOOL_PATH are added in front of the path already specified by
1352+
the PATH variable, and are added in the order specified.
13511353
\note This option is particularly useful for macOS version 14 (Sonoma) and higher,
13521354
when running Doxygen from Doxywizard, because in this case any user-defined changes to the PATH
13531355
are ignored. A typical example on macOS is to set
13541356
\verbatim
1355-
EXTERNAL_TOOL_PATHS = /Library/TeX/texbin /usr/local/bin
1357+
EXTERNAL_TOOL_PATH = /Library/TeX/texbin /usr/local/bin
1358+
\endverbatim
1359+
together with the standard path, the full search path used by doxygen when launching external tools
1360+
will then become
1361+
\verbatim
1362+
PATH=/Library/TeX/texbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
13561363
\endverbatim
13571364
]]>
13581365
</docs>

src/doxygen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11788,7 +11788,7 @@ void parseInput()
1178811788
AUTO_TRACE();
1178911789
std::atexit(exitDoxygen);
1179011790

11791-
Portable::correctPath(Config_getList(EXTERNAL_TOOL_PATHS));
11791+
Portable::correctPath(Config_getList(EXTERNAL_TOOL_PATH));
1179211792

1179311793
#if USE_LIBCLANG
1179411794
Doxygen::clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING);

src/portable.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,18 +526,26 @@ bool Portable::isAbsolutePath(const QCString &fileName)
526526
void Portable::correctPath(const StringVector &extraPaths)
527527
{
528528
QCString p = Portable::getenv("PATH");
529+
bool first=true;
530+
QCString result;
529531
#if defined(_WIN32) && !defined(__CYGWIN__)
530-
QCString result = substitute(p,"/","\\");
531532
for (const auto &path : extraPaths)
532533
{
533-
result+=";\""+substitute(QCString(path),"/","\\")+"\"";
534+
if (!first) result+=';';
535+
first=false;
536+
result += substitute(QCString(path),"/","\\");
534537
}
538+
if (!result.isEmpty() && !p.isEmpty()) result+=';';
539+
result += substitute(p,"/","\\");
535540
#else
536-
QCString result=p;
537541
for (const auto &path : extraPaths)
538542
{
539-
result+=":"+QCString(path);
543+
if (!first) result+=':';
544+
first=false;
545+
result += QCString(path);
540546
}
547+
if (!result.isEmpty() && !p.isEmpty()) result+=':';
548+
result += p;
541549
#endif
542550
if (result!=p) Portable::setenv("PATH",result.data());
543551
//printf("settingPath(%s) #extraPaths=%zu\n",Portable::getenv("PATH").data(),extraPaths.size());

0 commit comments

Comments
 (0)