Skip to content

FindDoxygen: Better GLOB handling on *NIX

noel requested to merge pylbert/cmake:master into master

The FindDoxygen file GLOB on LINUX was taking > 15 seconds to complete.

For

    file(
        GLOB _Doxygen_GRAPHVIZ_BIN_DIRS
        "$ENV{ProgramFiles}/Graphviz*/bin"
        "$ENV{ProgramFiles${_x86}}/Graphviz*/bin"
    )

It's possible for $ENV{ProgramFiles} to evaluate to nothing, so the GLOB takes /Graphviz*/bin as a path. Tracing this through the CXX, eventually ProcessDirectory gets called for each file/directory in '/'.

If a system has a slow(er) path mounted on '/' then the 'stat(name, &fs)' call in SystemTools.cxx can take some time.

There may be a better fix for this elsewhere, but an easy and straight-fwd approach was to only attempt the GLOB for $ENV{ProgramFiles} on WIN32.

Topic-rename: FindDoxygen-win-glob

Edited by Brad King

Merge request reports