summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorMichael Scott <michael.scott250@gmail.com>2015-11-08 12:59:27 (GMT)
committerBrad King <brad.king@kitware.com>2015-12-01 14:35:53 (GMT)
commit246b0bfbfda9a8f3091fc34fc92816aebaf60ae9 (patch)
tree50d689da4b5cb9993b98466cbebb8577b8bc8376 /Source/cmake.cxx
parentdeec3a3f06d341cfe0bef4e856b263eff347cc72 (diff)
downloadCMake-246b0bfbfda9a8f3091fc34fc92816aebaf60ae9.zip
CMake-246b0bfbfda9a8f3091fc34fc92816aebaf60ae9.tar.gz
CMake-246b0bfbfda9a8f3091fc34fc92816aebaf60ae9.tar.bz2
Explicitly enable author (dev) warnings by default.
Explicitly enable author warnings by default, via the cmake::GetSuppressDevWarnings method, which signals suppression is turned off unless the CMake variables are set as required. Add test cases for author and deprecated messages displayed by default.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx25
1 files changed, 20 insertions, 5 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 62476a1..5213130 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1580,6 +1580,7 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
{
this->AddCMakePaths();
}
+
// Add any cache args
if ( !this->SetCacheArgs(args) )
{
@@ -2511,11 +2512,7 @@ bool cmake::IsMessageTypeVisible(cmake::MessageType t)
}
else if (t == cmake::AUTHOR_WARNING)
{
- // if CMAKE_SUPPRESS_DEVELOPER_WARNINGS is on, suppress the message,
- // otherwise show it
- const char* suppressDevWarnings = this->State->GetCacheEntryValue(
- "CMAKE_SUPPRESS_DEVELOPER_WARNINGS");
- if(cmSystemTools::IsOn(suppressDevWarnings))
+ if (this->GetSuppressDevWarnings())
{
isVisible = false;
}
@@ -2807,3 +2804,21 @@ void cmake::RunCheckForUnusedVariables()
}
#endif
}
+
+bool cmake::GetSuppressDevWarnings(cmMakefile const* mf)
+{
+ /*
+ * The suppression CMake variable may be set in the CMake configuration file
+ * itself, so we have to check what its set to in the makefile if we can.
+ */
+ if (mf)
+ {
+ return mf->IsOn("CMAKE_SUPPRESS_DEVELOPER_WARNINGS");
+ }
+ else
+ {
+ const char* cacheEntryValue = this->State->GetCacheEntryValue(
+ "CMAKE_SUPPRESS_DEVELOPER_WARNINGS");
+ return cmSystemTools::IsOn(cacheEntryValue);
+ }
+}