summaryrefslogtreecommitdiffstats
path: root/Source/cmMacroCommand.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/cmMacroCommand.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/cmMacroCommand.cxx')
-rw-r--r--Source/cmMacroCommand.cxx28
1 files changed, 22 insertions, 6 deletions
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index f5c4187..6b92763 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.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 cmMacroHelperCommand::InvokeInitialPass
-(const std::vector<cmListFileArgument>& args)
+(const std::vector<cmListFileArgument>& args,
+ cmExecutionStatus &inStatus)
{
// Expand the argument list to the macro.
std::vector<std::string> expandedArgs;
@@ -233,7 +236,8 @@ bool cmMacroHelperCommand::InvokeInitialPass
}
newLFF.Arguments.push_back(arg);
}
- if(!this->Makefile->ExecuteCommand(newLFF))
+ cmExecutionStatus status;
+ if(!this->Makefile->ExecuteCommand(newLFF,status))
{
if(args.size())
{
@@ -253,12 +257,23 @@ bool cmMacroHelperCommand::InvokeInitialPass
cmSystemTools::Error(error.str().c_str());
return false;
}
+ if (status.GetReturnInvoked())
+ {
+ inStatus.SetReturnInvoked(true);
+ return true;
+ }
+ if (status.GetBreakInvoked())
+ {
+ inStatus.SetBreakInvoked(true);
+ return true;
+ }
}
return true;
}
bool cmMacroFunctionBlocker::
-IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
+IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
+ cmExecutionStatus &)
{
// record commands until we hit the ENDMACRO
// at the ENDMACRO call we shift gears and start looking for invocations
@@ -337,7 +352,8 @@ ScopeEnded(cmMakefile &mf)
this->Args[0].c_str());
}
-bool cmMacroCommand::InitialPass(std::vector<std::string> const& args)
+bool cmMacroCommand::InitialPass(std::vector<std::string> const& args,
+ cmExecutionStatus &)
{
if(args.size() < 1)
{