summaryrefslogtreecommitdiffstats
path: root/Source/cmWhileCommand.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/cmWhileCommand.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/cmWhileCommand.cxx')
-rw-r--r--Source/cmWhileCommand.cxx22
1 files changed, 18 insertions, 4 deletions
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx
index e4e17d9..9684221 100644
--- a/Source/cmWhileCommand.cxx
+++ b/Source/cmWhileCommand.cxx
@@ -18,7 +18,8 @@
#include "cmIfCommand.h"
bool cmWhileFunctionBlocker::
-IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
+IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
+ cmExecutionStatus &inStatus)
{
// Prevent recusion and don't let this blocker block its own
// commands.
@@ -51,7 +52,19 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
// Invoke all the functions that were collected in the block.
for(unsigned int c = 0; c < this->Functions.size(); ++c)
{
- mf.ExecuteCommand(this->Functions[c]);
+ cmExecutionStatus status;
+ mf.ExecuteCommand(this->Functions[c],status);
+ if (status.GetReturnInvoked())
+ {
+ inStatus.SetReturnInvoked(true);
+ mf.RemoveFunctionBlocker(lff);
+ return true;
+ }
+ if (status.GetBreakInvoked())
+ {
+ mf.RemoveFunctionBlocker(lff);
+ return true;
+ }
}
expandedArguments.clear();
mf.ExpandArguments(this->Args, expandedArguments);
@@ -99,8 +112,9 @@ ScopeEnded(cmMakefile &mf)
mf.GetCurrentDirectory());
}
-bool cmWhileCommand::InvokeInitialPass(
- const std::vector<cmListFileArgument>& args)
+bool cmWhileCommand
+::InvokeInitialPass(const std::vector<cmListFileArgument>& args,
+ cmExecutionStatus &)
{
if(args.size() < 1)
{