summaryrefslogtreecommitdiffstats
path: root/Source/cmSetCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmSetCommand.cxx')
-rw-r--r--Source/cmSetCommand.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index 204d95b..bf9f42c 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -79,8 +79,8 @@ bool cmSetCommand
bool cache = false; // optional
bool force = false; // optional
bool parentScope = false;
- cmCacheManager::CacheEntryType type
- = cmCacheManager::STRING; // required if cache
+ cmState::CacheEntryType type
+ = cmState::STRING; // required if cache
const char* docstring = 0; // required if cache
unsigned int ignoreLastArgs = 0;
@@ -131,20 +131,21 @@ bool cmSetCommand
if(cache)
{
std::string::size_type cacheStart = args.size() - 3 - (force ? 1 : 0);
- type = cmCacheManager::StringToType(args[cacheStart+1].c_str());
+ type = cmState::StringToCacheEntryType(args[cacheStart+1].c_str());
docstring = args[cacheStart+2].c_str();
}
// see if this is already in the cache
- cmCacheManager::CacheIterator it =
- this->Makefile->GetCacheManager()->GetCacheIterator(variable);
- if(!it.IsAtEnd() && (it.GetType() != cmCacheManager::UNINITIALIZED))
+ cmState* state = this->Makefile->GetState();
+ const char* existingValue = state->GetCacheEntryValue(variable);
+ if(existingValue &&
+ (state->GetCacheEntryType(variable) != cmState::UNINITIALIZED))
{
// 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 && !force)
+ if(cache && type != cmState::INTERNAL && !force)
{
return true;
}