summaryrefslogtreecommitdiffstats
path: root/Source/cmFunctionCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2008-01-23 15:28:26 (GMT)
committerKen Martin <ken.martin@kitware.com>2008-01-23 15:28:26 (GMT)
commit0e69d38004787f1d55eb7188cde4cf45e0a3957d (patch)
tree6cde7d0b5ef4b0b9b6d4fc90db463418e073776b /Source/cmFunctionCommand.cxx
parent72a301f88008c3d98c4ae1f263084763dc662b31 (diff)
downloadCMake-0e69d38004787f1d55eb7188cde4cf45e0a3957d.zip
CMake-0e69d38004787f1d55eb7188cde4cf45e0a3957d.tar.gz
CMake-0e69d38004787f1d55eb7188cde4cf45e0a3957d.tar.bz2
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
Diffstat (limited to 'Source/cmFunctionCommand.cxx')
-rw-r--r--Source/cmFunctionCommand.cxx23
1 files changed, 17 insertions, 6 deletions
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 5828cdd..1ff9d59 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -48,9 +48,11 @@ public:
* This is called when the command is first encountered in
* the CMakeLists.txt file.
*/
- virtual bool InvokeInitialPass(const std::vector<cmListFileArgument>& args);
+ virtual bool InvokeInitialPass(const std::vector<cmListFileArgument>& args,
+ cmExecutionStatus &);
- virtual bool InitialPass(std::vector<std::string> const&) { return false; };
+ virtual bool InitialPass(std::vector<std::string> const&,
+ cmExecutionStatus &) { return false; };
/**
* The name of the command as specified in CMakeList.txt.
@@ -83,7 +85,8 @@ public:
bool cmFunctionHelperCommand::InvokeInitialPass
-(const std::vector<cmListFileArgument>& args)
+(const std::vector<cmListFileArgument>& args,
+ cmExecutionStatus &)
{
// Expand the argument list to the function.
std::vector<std::string> expandedArgs;
@@ -153,7 +156,8 @@ bool cmFunctionHelperCommand::InvokeInitialPass
// for each function
for(unsigned int c = 0; c < this->Functions.size(); ++c)
{
- if (!this->Makefile->ExecuteCommand(this->Functions[c]))
+ cmExecutionStatus status;
+ if (!this->Makefile->ExecuteCommand(this->Functions[c],status))
{
cmOStringStream error;
error << "Error in cmake code at\n"
@@ -167,6 +171,11 @@ bool cmFunctionHelperCommand::InvokeInitialPass
this->Makefile->PopScope();
return false;
}
+ if (status.GetReturnInvoked())
+ {
+ this->Makefile->PopScope();
+ return true;
+ }
}
// pop scope on the makefile
@@ -175,7 +184,8 @@ bool cmFunctionHelperCommand::InvokeInitialPass
}
bool cmFunctionFunctionBlocker::
-IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
+IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
+ cmExecutionStatus &)
{
// record commands until we hit the ENDFUNCTION
// at the ENDFUNCTION call we shift gears and start looking for invocations
@@ -266,7 +276,8 @@ ScopeEnded(cmMakefile &mf)
this->Args[0].c_str());
}
-bool cmFunctionCommand::InitialPass(std::vector<std::string> const& args)
+bool cmFunctionCommand
+::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
{
if(args.size() < 1)
{