summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2008-08-23 17:33:13 (GMT)
committerDavid Cole <david.cole@kitware.com>2008-08-23 17:33:13 (GMT)
commitccf603f0c2570247b97fb6289aa4990302ada3fb (patch)
tree2c8f030131c043878b0caf30a908dfe080b8f66c /Source/cmFileCommand.cxx
parent2e0dd809575c13624a4ae0958fc8293d0f3e1e00 (diff)
downloadCMake-ccf603f0c2570247b97fb6289aa4990302ada3fb.zip
CMake-ccf603f0c2570247b97fb6289aa4990302ada3fb.tar.gz
CMake-ccf603f0c2570247b97fb6289aa4990302ada3fb.tar.bz2
ENH: Add the RECURSE_SYMLINKS_OFF flag to the FILE GLOB_RECURSE command. Exposes the recently added kwsys capability that prevents recursing through symlinks to CMake scripts.
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index e8e64a4..bbd8396 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -672,6 +672,18 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
bool first = true;
for ( ; i != args.end(); ++i )
{
+ if ( *i == "RECURSE_SYMLINKS_OFF" )
+ {
+ g.RecurseThroughSymlinksOff();
+ ++i;
+ if ( i == args.end() )
+ {
+ this->SetError(
+ "GLOB requires a glob expression after RECURSE_SYMLINKS_OFF");
+ return false;
+ }
+ }
+
if ( *i == "RELATIVE" )
{
++i; // skip RELATIVE
@@ -688,6 +700,7 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
return false;
}
}
+
if ( !cmsys::SystemTools::FileIsFullPath(i->c_str()) )
{
std::string expr = this->Makefile->GetCurrentDirectory();
@@ -706,6 +719,7 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
{
g.FindFiles(*i);
}
+
std::vector<std::string>::size_type cc;
std::vector<std::string>& files = g.GetFiles();
for ( cc = 0; cc < files.size(); cc ++ )