summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-03-24 13:44:23 (GMT)
committerBrad King <brad.king@kitware.com>2011-03-24 13:45:33 (GMT)
commita4335a621eabd74645dfdb6b0c731a6d354fcd30 (patch)
tree8b54f8b29f06e7935a3051cd0f838eed3284cdf4 /Source/cmake.cxx
parenta75ebe3ea48c957e3e7b8c1438ceb6136595eb61 (diff)
downloadCMake-a4335a621eabd74645dfdb6b0c731a6d354fcd30.zip
CMake-a4335a621eabd74645dfdb6b0c731a6d354fcd30.tar.gz
CMake-a4335a621eabd74645dfdb6b0c731a6d354fcd30.tar.bz2
Fix unused cache warning after multiple configure iterations
The curses dialog (ccmake) allows variables to be specified on the command line. If any of these variables is used during any configure iteration or during generate we must not warn about it. The Qt dialog (cmake-gui) allows variables to be added and removed in the GUI interactively. If a variable is added, removed, and then added again we must still warn if it is unused.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 221a2f3..7f7ca97 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -4306,7 +4306,10 @@ void cmake::WatchUnusedCli(const char* var)
{
#ifdef CMAKE_BUILD_WITH_CMAKE
this->VariableWatch->AddWatch(var, cmWarnUnusedCliWarning, this);
- this->UsedCliVariables[var] = false;
+ if(this->UsedCliVariables.find(var) == this->UsedCliVariables.end())
+ {
+ this->UsedCliVariables[var] = false;
+ }
#endif
}
@@ -4314,7 +4317,7 @@ void cmake::UnwatchUnusedCli(const char* var)
{
#ifdef CMAKE_BUILD_WITH_CMAKE
this->VariableWatch->RemoveWatch(var, cmWarnUnusedCliWarning);
- this->UsedCliVariables[var] = true;
+ this->UsedCliVariables.erase(var);
#endif
}