summaryrefslogtreecommitdiff
path: root/Source/cmMacroCommand.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-04-29 17:41:33 -0400
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-04-29 17:41:33 -0400
commit28f6e1b194cd71af7308cd2c91b438d8de72bc0d (patch)
treeca59d213a0c4924ed38c806ba473e19b09795fa4 /Source/cmMacroCommand.cxx
parent8750f1c277d8bf3fdf2d2986f473c5f09e293ea5 (diff)
downloadcmake-28f6e1b194cd71af7308cd2c91b438d8de72bc0d.tar.gz
ENH: Add ARGV and ARGN support to MACRO command. ARGV is the list of all arguments and ARGN is the list of all nonexpected arguments
Diffstat (limited to 'Source/cmMacroCommand.cxx')
-rw-r--r--Source/cmMacroCommand.cxx39
1 files changed, 39 insertions, 0 deletions
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 1fd86544aa..65154fe33c 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -107,6 +107,45 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
}
for (unsigned int j = 1; j < m_Args.size(); ++j)
{
+ variable = "${ARGV}";
+ std::vector<std::string>::iterator eit;
+ std::string var = "";
+ for ( eit = expandedArguments.begin();
+ eit != expandedArguments.end();
+ ++ eit )
+ {
+ if ( var.size() > 0 )
+ {
+ var += ";";
+ }
+ var += *eit;
+ }
+ cmSystemTools::ReplaceString(tmps, variable.c_str(),var.c_str());
+ }
+ for (unsigned int j = 1; j < m_Args.size(); ++j)
+ {
+ variable = "${ARGN}";
+ std::vector<std::string>::iterator eit;
+ std::string var = "";
+ std::vector<std::string>::size_type cnt = 0;
+ for ( eit = expandedArguments.begin();
+ eit != expandedArguments.end();
+ ++ eit )
+ {
+ if ( cnt >= m_Args.size()-1 )
+ {
+ if ( var.size() > 0 )
+ {
+ var += ";";
+ }
+ var += *eit;
+ }
+ cnt ++;
+ }
+ cmSystemTools::ReplaceString(tmps, variable.c_str(),var.c_str());
+ }
+ for (unsigned int j = 1; j < m_Args.size(); ++j)
+ {
// since this could be slow, first check if there is an ARGV
// only then do the inner loop. PS std::string sucks
char argvName[60];