diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmCacheManager.cxx | 4 | ||||
-rw-r--r-- | Source/cmake.cxx | 13 |
2 files changed, 16 insertions, 1 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 864df8e..ed09545 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -750,6 +750,10 @@ void cmCacheManager::AddCacheEntry(const char* key, } e.SetProperty("HELPSTRING", helpString? helpString : "(This variable does not exist and should not be used)"); + if (this->Cache[key].Value == e.Value) + { + this->CMakeInstance->UnwatchUnusedCli(key); + } this->Cache[key] = e; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index ae62edb..e757f3a 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -383,11 +383,22 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args) cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED; if(cmCacheManager::ParseEntry(entry.c_str(), var, value, type)) { + // The value is transformed if it is a filepath for example, so + // we can't compare whether the value is already in the cache until + // after we call AddCacheEntry. + const char *cachedValue = + this->CacheManager->GetCacheValue(var.c_str()); + this->CacheManager->AddCacheEntry(var.c_str(), value.c_str(), "No help, variable specified on the command line.", type); if(this->WarnUnusedCli) { - this->WatchUnusedCli(var.c_str()); + if (!cachedValue + || strcmp(this->CacheManager->GetCacheValue(var.c_str()), + cachedValue) != 0) + { + this->WatchUnusedCli(var.c_str()); + } } } else |