* Run build tools after parsing build files

* Generate roscfg.h


svn path=/branches/xmlbuildsystem/; revision=13496
This commit is contained in:
Casper Hornstrup
2005-02-11 19:13:01 +00:00
parent 63b4ab39e4
commit 760ebcb3e3
13 changed files with 354 additions and 63 deletions

View File

@@ -451,6 +451,21 @@ Module::HasFileWithExtensions ( const std::string& extension1,
return false;
}
void
Module::InvokeModule () const
{
for ( size_t i = 0; i < invocations.size (); i++ )
{
Invoke& invoke = *invocations[i];
string command = invoke.invokeModule->GetPath () + " " + invoke.GetParameters ();
printf ( "Executing '%s'\n\n", command.c_str () );
int exitcode = system ( command.c_str () );
if ( exitcode != 0 )
throw InvocationFailedException ( command,
exitcode );
}
}
File::File ( const string& _name, bool _first )
: name(_name), first(_first)
@@ -581,6 +596,40 @@ Invoke::GetTargets () const
return targets;
}
string
Invoke::GetParameters () const
{
string parameters ( "" );
size_t i;
for ( i = 0; i < output.size (); i++ )
{
if ( parameters.length () > 0)
parameters += " ";
InvokeFile& invokeFile = *output[i];
if ( invokeFile.switches.length () > 0 )
{
parameters += invokeFile.switches;
parameters += " ";
}
parameters += invokeFile.name;
}
for ( i = 0; i < input.size (); i++ )
{
if ( parameters.length () > 0 )
parameters += " ";
InvokeFile& invokeFile = *input[i];
if ( invokeFile.switches.length () > 0 )
{
parameters += invokeFile.switches;
parameters += " ";
}
parameters += invokeFile.name ;
}
return parameters;
}
InvokeFile::InvokeFile ( const XMLElement& _node,
const string& _name )