FIX: command now expands args during the first pass (found through FOREACH example)

This commit is contained in:
Sebastien Barre 2002-02-26 11:46:01 -05:00
parent f13c6545e1
commit ffb875f862
1 changed files with 11 additions and 9 deletions

View File

@ -31,8 +31,18 @@ bool cmAddTestCommand::InitialPass(std::vector<std::string> const& args)
} }
// store the arguments for the final pass // store the arguments for the final pass
// also expand any CMake variables
m_Args.erase(m_Args.begin(), m_Args.end()); 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; return true;
} }
@ -40,14 +50,6 @@ bool cmAddTestCommand::InitialPass(std::vector<std::string> const& args)
// creates the file in the final pass. // creates the file in the final pass.
void cmAddTestCommand::FinalPass() 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 // Create a full path filename for output Testfile
std::string fname; std::string fname;
fname = m_Makefile->GetStartOutputDirectory(); fname = m_Makefile->GetStartOutputDirectory();