ENH: add return and break support to cmake, also change basic command invocation signature to be able to return extra informaiton via the cmExecutionStatus class

This commit is contained in:
Ken Martin
2008-01-23 10:28:26 -05:00
parent 72a301f880
commit 0e69d38004
205 changed files with 907 additions and 360 deletions

View File

@@ -177,7 +177,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info)
// cmOutputRequiredFilesCommand
bool cmOutputRequiredFilesCommand
::InitialPass(std::vector<std::string> const& args)
::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
{
if(args.size() != 2 )
{
@@ -189,6 +189,21 @@ bool cmOutputRequiredFilesCommand
this->File = args[0];
this->OutputFile = args[1];
// compute the list of files
cmLBDepend md;
md.SetMakefile(this->Makefile);
md.AddSearchPath(this->Makefile->GetStartDirectory());
// find the depends for a file
const cmDependInformation *info = md.FindDependencies(this->File.c_str());
if (info)
{
// write them out
FILE *fout = fopen(this->OutputFile.c_str(),"w");
std::set<cmDependInformation const*> visited;
this->ListDependencies(info,fout, &visited);
fclose(fout);
}
return true;
}
@@ -221,20 +236,3 @@ ListDependencies(cmDependInformation const *info,
}
}
void cmOutputRequiredFilesCommand::FinalPass()
{
// compute the list of files
cmLBDepend md;
md.SetMakefile(this->Makefile);
md.AddSearchPath(this->Makefile->GetStartDirectory());
// find the depends for a file
const cmDependInformation *info = md.FindDependencies(this->File.c_str());
if (info)
{
// write them out
FILE *fout = fopen(this->OutputFile.c_str(),"w");
std::set<cmDependInformation const*> visited;
this->ListDependencies(info,fout, &visited);
fclose(fout);
}
}