mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user