From ca3b93d9c6a816afd7a07bf218c8884510219cf4 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 6 Mar 2009 10:04:06 -0500 Subject: ENH: Teach message() how to display warnings This adds message(WARNING) and message(AUTHOR_WARNING) command modes and fully documents the command behavior in all modes. --- Source/cmMessageCommand.cxx | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) (limited to 'Source/cmMessageCommand.cxx') diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index a6f5808b6f..7e66e05dba 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -28,29 +28,27 @@ bool cmMessageCommand std::string message; std::vector::const_iterator i = args.begin(); - bool send_error = false; - bool fatal_error = false; + cmake::MessageType type = cmake::MESSAGE; bool status = false; - if (*i == "SEND_ERROR") + if (*i == "SEND_ERROR" || *i == "FATAL_ERROR") { - send_error = true; + type = cmake::FATAL_ERROR; ++i; } - else + else if (*i == "WARNING") { - if (*i == "STATUS") - { - status = true; - ++i; - } - else - { - if (*i == "FATAL_ERROR") - { - fatal_error = true; - ++i; - } - } + type = cmake::WARNING; + ++i; + } + else if (*i == "AUTHOR_WARNING") + { + type = cmake::AUTHOR_WARNING; + ++i; + } + else if (*i == "STATUS") + { + status = true; + ++i; } for(;i != args.end(); ++i) @@ -58,9 +56,9 @@ bool cmMessageCommand message += *i; } - if (send_error || fatal_error) + if (type != cmake::MESSAGE) { - this->Makefile->IssueMessage(cmake::FATAL_ERROR, message.c_str()); + this->Makefile->IssueMessage(type, message.c_str()); } else { @@ -73,10 +71,6 @@ bool cmMessageCommand cmSystemTools::Message(message.c_str()); } } - if(fatal_error ) - { - cmSystemTools::SetFatalErrorOccured(); - } return true; } -- cgit v1.2.1