diff options
author | David Cole <david.cole@kitware.com> | 2008-08-20 17:24:16 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2008-08-20 17:24:16 (GMT) |
commit | 86e7a9dad874fb8e4bc6405f72437c80cc3936fe (patch) | |
tree | 933700cee0acae425a8937bfe2458ff4afd4bc65 /Source/kwsys/Glob.cxx | |
parent | fff812db95cea0844833e1cde2942ee52bffe911 (diff) | |
download | CMake-86e7a9dad874fb8e4bc6405f72437c80cc3936fe.zip CMake-86e7a9dad874fb8e4bc6405f72437c80cc3936fe.tar.gz CMake-86e7a9dad874fb8e4bc6405f72437c80cc3936fe.tar.bz2 |
ENH: Add RecurseThroughSymlinks data member to kwsys::Glob. Allows recursive globs to skip symlinks when necessary. Default to true for backwards compatible behavior. Used from the ctest coverage handler to avoid recursing through the '/Applications' directory on the Mac looking for *.da files... Should fix the hangs reported recently by Mac CMake dashboard submitters.
Diffstat (limited to 'Source/kwsys/Glob.cxx')
-rw-r--r-- | Source/kwsys/Glob.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/kwsys/Glob.cxx b/Source/kwsys/Glob.cxx index 6858689..80fdf29 100644 --- a/Source/kwsys/Glob.cxx +++ b/Source/kwsys/Glob.cxx @@ -63,6 +63,10 @@ Glob::Glob() this->Internals = new GlobInternals; this->Recurse = false; this->Relative = ""; + + this->RecurseThroughSymlinks = true; + // RecurseThroughSymlinks is true by default for backwards compatibility, + // not because it's a good idea... } //---------------------------------------------------------------------------- @@ -262,7 +266,11 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start, } if ( kwsys::SystemTools::FileIsDirectory(realname.c_str()) ) { - this->RecurseDirectory(start+1, realname, dir_only); + if (!kwsys::SystemTools::FileIsSymlink(realname.c_str()) || + this->RecurseThroughSymlinks) + { + this->RecurseDirectory(start+1, realname, dir_only); + } } } } |