summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-06-05 13:39:18 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-06-05 13:39:18 (GMT)
commit21b10265419800942ed0806f0e0f5cf6da260bad (patch)
treee8cf2368939ac222ab4d480b7686bd7bd3a24697 /Source
parent2cd8a6a3c6d505674e113345c58edfb19bf8dc2e (diff)
parent273ecab96d47d6ddba129be6200bc93ba7910b8c (diff)
downloadCMake-21b10265419800942ed0806f0e0f5cf6da260bad.zip
CMake-21b10265419800942ed0806f0e0f5cf6da260bad.tar.gz
CMake-21b10265419800942ed0806f0e0f5cf6da260bad.tar.bz2
Merge topic 'suppress-unused-cli-with-value-in-cache'
273ecab CLI: Suppress the unused warning if the key value pair is cached.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCacheManager.cxx4
-rw-r--r--Source/cmake.cxx13
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