diff options
author | Brad King <brad.king@kitware.com> | 2011-03-24 13:44:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2011-03-24 13:45:33 (GMT) |
commit | a4335a621eabd74645dfdb6b0c731a6d354fcd30 (patch) | |
tree | 8b54f8b29f06e7935a3051cd0f838eed3284cdf4 /Source/cmake.cxx | |
parent | a75ebe3ea48c957e3e7b8c1438ceb6136595eb61 (diff) | |
download | CMake-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.cxx | 7 |
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 } |