summaryrefslogtreecommitdiffstats
path: root/Source/cmAddTestCommand.cxx
diff options
context:
space:
mode:
authorSebastien Barre <sebastien.barre@kitware.com>2002-02-26 16:46:01 (GMT)
committerSebastien Barre <sebastien.barre@kitware.com>2002-02-26 16:46:01 (GMT)
commitffb875f862219c66b6da21f6fb0d43f84e639d76 (patch)
tree835390f5ae856450cf168a96dd830caa196efcf8 /Source/cmAddTestCommand.cxx
parentf13c6545e188ad28d61b4321e99970c139a63253 (diff)
downloadCMake-ffb875f862219c66b6da21f6fb0d43f84e639d76.zip
CMake-ffb875f862219c66b6da21f6fb0d43f84e639d76.tar.gz
CMake-ffb875f862219c66b6da21f6fb0d43f84e639d76.tar.bz2
FIX: command now expands args during the first pass (found through FOREACH example)
Diffstat (limited to 'Source/cmAddTestCommand.cxx')
-rw-r--r--Source/cmAddTestCommand.cxx20
1 files changed, 11 insertions, 9 deletions
diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx
index 527622d..01f297a 100644
--- a/Source/cmAddTestCommand.cxx
+++ b/Source/cmAddTestCommand.cxx
@@ -31,8 +31,18 @@ bool cmAddTestCommand::InitialPass(std::vector<std::string> const& args)
}
// store the arguments for the final pass
+ // also expand any CMake variables
+
m_Args.erase(m_Args.begin(), m_Args.end());
- std::copy(args.begin(),args.end(),std::back_inserter(m_Args));
+ std::string temp;
+ for (std::vector<std::string>::const_iterator j = args.begin();
+ j != args.end(); ++j)
+ {
+ temp = *j;
+ m_Makefile->ExpandVariablesInString(temp);
+ m_Args.push_back(temp);
+ }
+
return true;
}
@@ -40,14 +50,6 @@ bool cmAddTestCommand::InitialPass(std::vector<std::string> const& args)
// creates the file in the final pass.
void cmAddTestCommand::FinalPass()
{
-
- // Expand any CMake variables
- std::vector<std::string>::iterator s;
- for (s = m_Args.begin(); s != m_Args.end(); ++s)
- {
- m_Makefile->ExpandVariablesInString(*s);
- }
-
// Create a full path filename for output Testfile
std::string fname;
fname = m_Makefile->GetStartOutputDirectory();