summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-05-21 22:33:45 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-05-21 22:54:27 (GMT)
commit55fc5e7c9ad018bbb90fbcee6ac09cf224b46246 (patch)
tree4f31056b889c600b1b5f6a93c9ba2efb15596c6a /Source
parentca7cc2ebd0bd17b70279a51a3a087b5629175f06 (diff)
downloadCMake-55fc5e7c9ad018bbb90fbcee6ac09cf224b46246.zip
CMake-55fc5e7c9ad018bbb90fbcee6ac09cf224b46246.tar.gz
CMake-55fc5e7c9ad018bbb90fbcee6ac09cf224b46246.tar.bz2
cmake: Extract printMessageText method.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmake.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 29f84df..565db8b 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2477,6 +2477,14 @@ bool cmake::PrintMessagePreamble(cmake::MessageType t, std::ostream& msg)
return true;
}
+void printMessageText(std::ostream& msg, std::string const& text)
+{
+ msg << ":\n";
+ cmDocumentationFormatter formatter;
+ formatter.SetIndent(" ");
+ formatter.PrintFormatted(msg, text.c_str());
+}
+
//----------------------------------------------------------------------------
void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
cmListFileBacktrace const& bt)
@@ -2493,13 +2501,7 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
// Add the immediate context.
backtrace.PrintTitle(msg);
- // Add the message text.
- {
- msg << ":\n";
- cmDocumentationFormatter formatter;
- formatter.SetIndent(" ");
- formatter.PrintFormatted(msg, text.c_str());
- }
+ printMessageText(msg, text);
// Add the rest of the context.
backtrace.PrintCallStack(msg);