diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-03-21 21:03:19 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-03-21 21:03:19 (GMT) |
commit | d41f97a5e6fb47399cff87aa96979f6b7196a763 (patch) | |
tree | cbcbed2a7a5d08927088e5fc072dab25aa0af10a /Source | |
parent | 9dbf4438dcf2d08477b140edc0a15927377699d3 (diff) | |
download | CMake-d41f97a5e6fb47399cff87aa96979f6b7196a763.zip CMake-d41f97a5e6fb47399cff87aa96979f6b7196a763.tar.gz CMake-d41f97a5e6fb47399cff87aa96979f6b7196a763.tar.bz2 |
ENH: Add relative tag and add test for relative tag
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFileCommand.cxx | 11 | ||||
-rw-r--r-- | Source/cmFileCommand.h | 8 |
2 files changed, 16 insertions, 3 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index a93e517..02b6913 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -210,6 +210,17 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args, bool first = true; for ( ; i != args.end(); ++i ) { + if ( *i == "RELATIVE" ) + { + ++i; // skip RELATIVE + if ( i == args.end() ) + { + this->SetError("GLOB requires a directory after the RELATIVE tag"); + return false; + } + g.SetRelative(i->c_str()); + ++i; + } if ( !cmsys::SystemTools::FileIsFullPath(i->c_str()) ) { std::string expr = this->Makefile->GetCurrentDirectory(); diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h index fe27bf6..324254f 100644 --- a/Source/cmFileCommand.h +++ b/Source/cmFileCommand.h @@ -67,8 +67,8 @@ public: " FILE(WRITE filename \"message to write\"... )\n" " FILE(APPEND filename \"message to write\"... )\n" " FILE(READ filename variable)\n" - " FILE(GLOB variable [globbing expressions]...)\n" - " FILE(GLOB_RECURSE variable [globbing expressions]...)\n" + " FILE(GLOB variable [RELATIVE path] [globbing expressions]...)\n" + " FILE(GLOB_RECURSE variable [RELATIVE path] [globbing expressions]...)\n" " FILE(REMOVE [directory]...)\n" " FILE(REMOVE_RECURSE [directory]...)\n" " FILE(MAKE_DIRECTORY [directory]...)\n" @@ -87,7 +87,9 @@ public: "variable.\n" "GLOB will generate a list of all files that match the globbing " "expressions and store it into the variable. Globbing expressions " - "are similar to regular expressions, but much simpler.\n" + "are similar to regular expressions, but much simpler. If RELATIVE " + "flag is specified for an expression, the results will be returned " + "as a relative path to the given path.\n" "Examples of globbing expressions include:\n" " *.cxx - match all files with extension cxx\n" " *.vt? - match all files with extension vta,...,vtz\n" |