summaryrefslogtreecommitdiffstats
path: root/Source/cmSetCommand.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-09-27 20:19:37 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-09-27 20:19:37 (GMT)
commiteb6bba34cd2fcef722f8db55d81beb6393e83744 (patch)
treeb289d39b56c0fff5ba4c564b2892046dfa4c0769 /Source/cmSetCommand.cxx
parentcc6d56182dd740d248e37dfe1139f4f2c56bba75 (diff)
downloadCMake-eb6bba34cd2fcef722f8db55d81beb6393e83744.zip
CMake-eb6bba34cd2fcef722f8db55d81beb6393e83744.tar.gz
CMake-eb6bba34cd2fcef722f8db55d81beb6393e83744.tar.bz2
BUG: fix doc string and allow a variable to be promoted from non-cache to cache
Diffstat (limited to 'Source/cmSetCommand.cxx')
-rw-r--r--Source/cmSetCommand.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index 6065780..083f422 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -107,19 +107,21 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args)
type = cmCacheManager::StringToType(args[cacheStart+1].c_str());
docstring = args[cacheStart+2].c_str();
}
- // get the current cache value for the variable
- const char* cacheValue =
- m_Makefile->GetDefinition(variable);
- if(cacheValue)
+ // see if this is already in the cache
+ cmCacheManager::CacheIterator it =
+ m_Makefile->GetCacheManager()->GetCacheIterator(variable);
+ if(!it.IsAtEnd())
{
- // if it is not a cached value, or it is a cached
- // value that is not internal keep the value found
- // in the cache
+ // if the set is trying to CACHE the value but the value
+ // is already in the cache and the type is not internal
+ // then leave now without setting any definitions in the cache
+ // or the makefile
if(cache && type != cmCacheManager::INTERNAL)
{
return true;
}
}
+
// if it is meant to be in the cache then define it in the cache
if(cache)
{