summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoel Eck <noel.eck@intel.com>2018-11-26 15:25:26 (GMT)
committerBrad King <brad.king@kitware.com>2018-11-26 19:39:36 (GMT)
commit85a035bf00d53d33251f30f850be7be169cbcde8 (patch)
treee00d0e35cb7cb2d3669dc98546df4354483e2438
parent5bc33226b2a0e8ff3c80b292abbfbc6f6b2c405b (diff)
downloadCMake-85a035bf00d53d33251f30f850be7be169cbcde8.zip
CMake-85a035bf00d53d33251f30f850be7be169cbcde8.tar.gz
CMake-85a035bf00d53d33251f30f850be7be169cbcde8.tar.bz2
FindDoxygen: Avoid Windows-specific GLOB on other platforms
When `$ENV{ProgramFiles}` is empty, GLOB takes `/Graphviz*/bin` as a path cusing the implementation to look at every directory in `/`. If the system has a slow(er) path mounted on '/' then `stat` call can take some time. There *may* be a better fix for this elsewhere, but for now simply do this GLOB only on Windows. Signed-off-by: Noel Eck <noel.eck@intel.com>
-rw-r--r--Modules/FindDoxygen.cmake19
1 files changed, 12 insertions, 7 deletions
diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake
index 2ed9449..fdd3a92 100644
--- a/Modules/FindDoxygen.cmake
+++ b/Modules/FindDoxygen.cmake
@@ -485,12 +485,18 @@ endmacro()
# Find Graphviz Dot...
#
macro(_Doxygen_find_dot)
- set(_x86 "(x86)")
- file(
- GLOB _Doxygen_GRAPHVIZ_BIN_DIRS
- "$ENV{ProgramFiles}/Graphviz*/bin"
- "$ENV{ProgramFiles${_x86}}/Graphviz*/bin"
- )
+ if(WIN32)
+ set(_x86 "(x86)")
+ file(
+ GLOB _Doxygen_GRAPHVIZ_BIN_DIRS
+ "$ENV{ProgramFiles}/Graphviz*/bin"
+ "$ENV{ProgramFiles${_x86}}/Graphviz*/bin"
+ )
+ unset(_x86)
+ else()
+ set(_Doxygen_GRAPHVIZ_BIN_DIRS "")
+ endif()
+
find_program(
DOXYGEN_DOT_EXECUTABLE
NAMES dot
@@ -529,7 +535,6 @@ macro(_Doxygen_find_dot)
endif()
unset(_Doxygen_GRAPHVIZ_BIN_DIRS)
- unset(_x86)
endmacro()
#