cmake: Move isError determination to a more-natural place.

This commit is contained in:
Stephen Kelly 2015-05-22 00:28:19 +02:00
parent 3541fc73a1
commit fa752bf339
1 changed files with 3 additions and 5 deletions

View File

@ -2444,16 +2444,13 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
backtrace.MakeRelative(); backtrace.MakeRelative();
std::ostringstream msg; std::ostringstream msg;
bool isError = false;
// Construct the message header. // Construct the message header.
if(t == cmake::FATAL_ERROR) if(t == cmake::FATAL_ERROR)
{ {
isError = true;
msg << "CMake Error"; msg << "CMake Error";
} }
else if(t == cmake::INTERNAL_ERROR) else if(t == cmake::INTERNAL_ERROR)
{ {
isError = true;
msg << "CMake Internal Error (please report a bug)"; msg << "CMake Internal Error (please report a bug)";
} }
else if(t == cmake::LOG) else if(t == cmake::LOG)
@ -2463,7 +2460,6 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
else if(t == cmake::DEPRECATION_ERROR) else if(t == cmake::DEPRECATION_ERROR)
{ {
msg << "CMake Deprecation Error"; msg << "CMake Deprecation Error";
isError = true;
} }
else if (t == cmake::DEPRECATION_WARNING) else if (t == cmake::DEPRECATION_WARNING)
{ {
@ -2526,7 +2522,9 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
#endif #endif
// Output the message. // Output the message.
if(isError) if(t == cmake::FATAL_ERROR
|| t == cmake::INTERNAL_ERROR
|| t == cmake::DEPRECATION_ERROR)
{ {
cmSystemTools::SetErrorOccured(); cmSystemTools::SetErrorOccured();
cmSystemTools::Message(msg.str().c_str(), "Error"); cmSystemTools::Message(msg.str().c_str(), "Error");