Make message suppression more consistent.

Make the message suppression more consistent, by adding a check
for the message related CMake variables in cmake::IssueMessage,
which allows callers of IssueMessage other than the message
command to behave as expected. Also added a check for
CMAKE_SUPPRESS_DEVELOPER_WARNINGS in the message command to
mirror the deprecated message type behaviour.

Added a 'force' flag to the cmake::IssueMessage method, to
make the message suppression consistent, when setting the
message related CMake variables directly in a CMake file.

Expand message command tests to cover the AUTHOR_WARNING message
type as well.
This commit is contained in:
Michael Scott
2015-11-08 12:20:47 +00:00
committed by Brad King
parent aa427a4239
commit deec3a3f06
8 changed files with 102 additions and 24 deletions

View File

@@ -43,7 +43,14 @@ bool cmMessageCommand
}
else if (*i == "AUTHOR_WARNING")
{
type = cmake::AUTHOR_WARNING;
if (this->Makefile->IsOn("CMAKE_SUPPRESS_DEVELOPER_WARNINGS"))
{
return true;
}
else
{
type = cmake::AUTHOR_WARNING;
}
++i;
}
else if (*i == "STATUS")
@@ -73,7 +80,8 @@ bool cmMessageCommand
if (type != cmake::MESSAGE)
{
this->Makefile->IssueMessage(type, message);
// we've overriden the message type, above, so force IssueMessage to use it
this->Makefile->IssueMessage(type, message, true);
}
else
{