summaryrefslogtreecommitdiffstats
path: root/Source/cmMacroCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-03-07 13:40:36 (GMT)
committerBrad King <brad.king@kitware.com>2008-03-07 13:40:36 (GMT)
commit680104a490250f7b56b67aa3cbb7c113d997e93c (patch)
tree52af6beb6a876f03a1205c050ad8295e338ca573 /Source/cmMacroCommand.cxx
parent41a59e211ef6b0c9c839545661579934ce9415c1 (diff)
downloadCMake-680104a490250f7b56b67aa3cbb7c113d997e93c.zip
CMake-680104a490250f7b56b67aa3cbb7c113d997e93c.tar.gz
CMake-680104a490250f7b56b67aa3cbb7c113d997e93c.tar.bz2
ENH: New format for warning and error messages
- Add cmMakefile methods IssueError and IssueWarning - Maintain an explicit call stack in cmMakefile - Include context/call-stack info in messages - Nested errors now unwind the call stack - Use new mechanism for policy warnings and errors - Improve policy error message - Include cmExecutionStatus pointer in call stack so that errors deeper in the C++ stack under a command invocation will become errors for the command
Diffstat (limited to 'Source/cmMacroCommand.cxx')
-rw-r--r--Source/cmMacroCommand.cxx22
1 files changed, 5 insertions, 17 deletions
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 9f1c904..7c4a644 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -237,24 +237,12 @@ bool cmMacroHelperCommand::InvokeInitialPass
newLFF.Arguments.push_back(arg);
}
cmExecutionStatus status;
- if(!this->Makefile->ExecuteCommand(newLFF,status))
+ if(!this->Makefile->ExecuteCommand(newLFF, status) ||
+ status.GetNestedError())
{
- if(args.size())
- {
- arg.FilePath = args[0].FilePath;
- arg.Line = args[0].Line;
- }
- else
- {
- arg.FilePath = "Unknown";
- arg.Line = 0;
- }
- cmOStringStream error;
- error << "Error in cmake code at\n"
- << arg.FilePath << ":" << arg.Line << ":\n"
- << "A command failed during the invocation of macro \""
- << this->Args[0].c_str() << "\".";
- cmSystemTools::Error(error.str().c_str());
+ // The error message should have already included the call stack
+ // so we do not need to report an error here.
+ inStatus.SetNestedError(true);
return false;
}
if (status.GetReturnInvoked())