From fc26c1459caa61c79b9076e3ca85905e45bbcbc9 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 11 Mar 2008 22:50:35 -0400 Subject: [PATCH] ENH: add ability to suppress dev warnings to gui code --- Source/cmake.cxx | 32 ++++++++++++++++++++------------ Source/cmake.h | 6 +++++- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index e4d2ead72..c6b405264 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -139,6 +139,7 @@ void cmNeedBackwardsCompatibility(const std::string& variable, cmake::cmake() { + this->SuppressDevWarnings = false; this->DebugOutput = false; this->DebugTryCompile = false; this->ClearBuildSystem = false; @@ -376,20 +377,11 @@ bool cmake::SetCacheArgs(const std::vector& args) } 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); + this->SuppressDevWarnings = true; } 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); - + this->SuppressDevWarnings = false; } else if(arg.find("-U",0) == 0) { @@ -1885,6 +1877,23 @@ int cmake::HandleDeleteCacheVariables(const char* var) int cmake::Configure() { + if(this->SuppressDevWarnings) + { + this->CacheManager-> + AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "TRUE", + "Suppress Warnings that are meant for" + " the author of the CMakeLists.txt files.", + cmCacheManager::INTERNAL); + } + else + { + this->CacheManager-> + AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "FALSE", + "Suppress Warnings that are meant for" + " the author of the CMakeLists.txt files.", + cmCacheManager::INTERNAL); + } + int ret = this->ActualConfigure(); const char* delCacheVars = this->GetProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_"); @@ -2185,7 +2194,6 @@ int cmake::Run(const std::vector& args, bool noconfigure) { this->AddCMakePaths(); } - // Add any cache args if ( !this->SetCacheArgs(args) ) { diff --git a/Source/cmake.h b/Source/cmake.h index b4d60360e..416db7ff2 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -344,6 +344,10 @@ class cmake { this->CMakeEditCommand = s; } + void SetSuppressDevWarnings(bool v) + { + this->SuppressDevWarnings = v; + } protected: int HandleDeleteCacheVariables(const char* var); cmPropertyMap Properties; @@ -376,7 +380,7 @@ protected: std::string HomeOutputDirectory; std::string cmStartDirectory; std::string StartOutputDirectory; - + bool SuppressDevWarnings; std::set WrittenFiles; ///! return true if the same cmake was used to make the cache.