summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorMichael Scott <michael.scott250@gmail.com>2015-11-08 23:34:59 (GMT)
committerBrad King <brad.king@kitware.com>2015-12-01 15:22:45 (GMT)
commite8974b62d7883adf100d4c6ad90a0fbf682aaa91 (patch)
tree0d2c155ab404562b9485211ac61aadfba6355468 /Source
parentb146747ed7f3cee8d8ef9c3ea6899ec3135aa527 (diff)
downloadCMake-e8974b62d7883adf100d4c6ad90a0fbf682aaa91.zip
CMake-e8974b62d7883adf100d4c6ad90a0fbf682aaa91.tar.gz
CMake-e8974b62d7883adf100d4c6ad90a0fbf682aaa91.tar.bz2
Modify dev warning options to affect deprecated warnings.
Change the '-Wdev' and '-Wno-dev' options to also enable and suppress the deprecated warnings output, via the 'CMAKE_WARN_DEPRECATED' CMake variable, by default. This action does not happen if the user specifies a deprecated warning message option. Add tests and update the documentation for the new functionality.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmake.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 37d7e0a..6481c78 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1285,6 +1285,16 @@ int cmake::Configure()
if (this->DiagLevels.count("dev") == 1)
{
+ bool setDeprecatedVariables = false;
+
+ const char* cachedWarnDeprecated =
+ this->State->GetCacheEntryValue("CMAKE_WARN_DEPRECATED");
+
+ // don't overwrite deprecated warning setting from a previous invocation
+ if (!cachedWarnDeprecated)
+ {
+ setDeprecatedVariables = true;
+ }
diagLevel = this->DiagLevels["dev"];
if (diagLevel == DIAG_IGNORE)
@@ -1293,6 +1303,14 @@ int cmake::Configure()
"Suppress Warnings that are meant for"
" the author of the CMakeLists.txt files.",
cmState::INTERNAL);
+
+ if (setDeprecatedVariables)
+ {
+ this->AddCacheEntry("CMAKE_WARN_DEPRECATED", "FALSE",
+ "Whether to issue warnings for deprecated "
+ "functionality.",
+ cmState::INTERNAL);
+ }
}
else if (diagLevel == DIAG_WARN)
{
@@ -1300,6 +1318,14 @@ int cmake::Configure()
"Suppress Warnings that are meant for"
" the author of the CMakeLists.txt files.",
cmState::INTERNAL);
+
+ if (setDeprecatedVariables)
+ {
+ this->AddCacheEntry("CMAKE_WARN_DEPRECATED", "TRUE",
+ "Whether to issue warnings for deprecated "
+ "functionality.",
+ cmState::INTERNAL);
+ }
}
}