From 0e69d38004787f1d55eb7188cde4cf45e0a3957d Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Wed, 23 Jan 2008 10:28:26 -0500 Subject: 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 --- Source/cmOutputRequiredFilesCommand.cxx | 34 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'Source/cmOutputRequiredFilesCommand.cxx') diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index e15fea2df4..98dfabce66 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/Source/cmOutputRequiredFilesCommand.cxx @@ -177,7 +177,7 @@ void cmLBDepend::DependWalk(cmDependInformation* info) // cmOutputRequiredFilesCommand bool cmOutputRequiredFilesCommand -::InitialPass(std::vector const& args) +::InitialPass(std::vector 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 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 visited; - this->ListDependencies(info,fout, &visited); - fclose(fout); - } -} -- cgit v1.2.1