Commit a547ff61 authored by Bill Hoffman's avatar Bill Hoffman
Browse files

ENH: add a way to suppress the new policy warnings, still need ccmake and gui's

parent 5d2b9009
......@@ -296,7 +296,16 @@ void cmMakefile::IssueMessage(cmake::MessageType t, std::string const& text) con
}
else
{
msg << "CMake Warning:";
msg << "CMake Warning";
if(t == cmake::AUTHOR_WARNING)
{
if(this->IsOn("CMAKE_SUPPRESS_DEVELOPER_WARNINGS"))
{
return;
}
msg << "(Code)";
}
msg << ":";
}
// Add the immediate context.
......@@ -2462,7 +2471,16 @@ int cmMakefile::TryCompile(const char *srcdir, const char *bindir,
// to save time we pass the EnableLanguage info directly
gg->EnableLanguagesFromGenerator
(this->LocalGenerator->GetGlobalGenerator());
if(this->IsOn("CMAKE_SUPPRESS_DEVELOPER_WARNINGS"))
{
cm.AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS",
"TRUE", "", cmCacheManager::INTERNAL);
}
else
{
cm.AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS",
"FALSE", "", cmCacheManager::INTERNAL);
}
if (cm.Configure() != 0)
{
cmSystemTools::Error(
......
......@@ -373,6 +373,23 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
return false;
}
}
else if(arg.find("-Wno-dev",0) == 0)
{
this->CacheManager->
AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "TRUE",
"Suppress Warnings that are meant for"
" the author of the CMakeLists.txt files.",
cmCacheManager::INTERNAL);
}
else if(arg.find("-Wdev",0) == 0)
{
this->CacheManager->
AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "FALSE",
"Suppress Warnings that are meant for"
" the author of the CMakeLists.txt files.",
cmCacheManager::INTERNAL);
}
else if(arg.find("-U",0) == 0)
{
std::string entryPattern = arg.substr(2);
......
......@@ -81,6 +81,12 @@ static const char * cmDocumentationOptions[][3] =
"variables being created. If A is specified, then it will display also "
"advanced variables. If H is specified, it will also display help for "
"each variable."},
{"-Wno-dev", "Suppress developer warnings.",
"Suppress warnings that are meant for the author"
" of the CMakeLists.txt files."},
{"-Wdev", "Enable developer warnings.",
"Enable warnings that are meant for the author"
" of the CMakeLists.txt files."},
{"-N", "View mode only.",
"Only load the cache. Do not actually run configure and generate steps."},
{"-P <file>", "Process script mode.",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment