diff options
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 35fdd0c..ad3cce4 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -18,7 +18,7 @@ #include "cmGlobalGenerator.h" #include "cmLocalGenerator.h" #include "cmCommands.h" -#include "cmCacheManager.h" +#include "cmState.h" #include "cmFunctionBlocker.h" #include "cmListFileCache.h" #include "cmCommandArgumentParserHelper.h" @@ -1778,16 +1778,16 @@ void cmMakefile::AddDefinition(const std::string& name, const char* value) void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, const char* doc, - cmCacheManager::CacheEntryType type, + cmState::CacheEntryType type, bool force) { bool haveVal = value ? true : false; std::string val = haveVal ? value : ""; const char* existingValue = - this->GetCacheManager()->GetInitializedCacheValue(name); + this->GetState()->GetInitializedCacheValue(name); if(existingValue - && (this->GetCacheManager()->GetCacheEntryType(name) - == cmCacheManager::UNINITIALIZED)) + && (this->GetState()->GetCacheEntryType(name) + == cmState::UNINITIALIZED)) { // if this is not a force, then use the value from the cache // if it is a force, then use the value being passed in @@ -1796,7 +1796,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, val = existingValue; haveVal = true; } - if ( type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH ) + if ( type == cmState::PATH || type == cmState::FILEPATH ) { std::vector<std::string>::size_type cc; std::vector<std::string> files; @@ -1815,14 +1815,14 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value, nvalue += files[cc]; } - this->GetCacheManager()->AddCacheEntry(name, nvalue.c_str(), doc, type); - val = this->GetCacheManager()->GetInitializedCacheValue(name); + this->GetState()->AddCacheEntry(name, nvalue.c_str(), doc, type); + val = this->GetState()->GetInitializedCacheValue(name); haveVal = true; } } - this->GetCacheManager()->AddCacheEntry(name, haveVal ? val.c_str() : 0, - doc, type); + this->GetState()->AddCacheEntry(name, haveVal ? val.c_str() : 0, + doc, type); // if there was a definition then remove it this->Internal->VarStack.top().Set(name, 0); } @@ -1949,7 +1949,7 @@ void cmMakefile::RemoveDefinition(const std::string& name) void cmMakefile::RemoveCacheDefinition(const std::string& name) { - this->GetCacheManager()->RemoveCacheEntry(name); + this->GetState()->RemoveCacheEntry(name); } void cmMakefile::SetProjectName(const char* p) @@ -2406,7 +2406,7 @@ bool cmMakefile::IsDefinitionSet(const std::string& name) const this->Internal->VarUsageStack.top().insert(name); if(!def) { - def = this->GetCacheManager()->GetInitializedCacheValue(name); + def = this->GetState()->GetInitializedCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE if(cmVariableWatch* vv = this->GetVariableWatch()) @@ -2431,7 +2431,7 @@ const char* cmMakefile::GetDefinition(const std::string& name) const const char* def = this->Internal->VarStack.top().Get(name); if(!def) { - def = this->GetCacheManager()->GetInitializedCacheValue(name); + def = this->GetState()->GetInitializedCacheValue(name); } #ifdef CMAKE_BUILD_WITH_CMAKE cmVariableWatch* vv = this->GetVariableWatch(); @@ -2473,7 +2473,7 @@ std::vector<std::string> cmMakefile res.insert(res.end(), definitions.begin(), definitions.end()); } std::vector<std::string> cacheKeys = - this->GetCacheManager()->GetCacheEntryKeys(); + this->GetState()->GetCacheEntryKeys(); res.insert(res.end(), cacheKeys.begin(), cacheKeys.end()); std::sort(res.begin(), res.end()); @@ -2774,6 +2774,8 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( openstack.push(t_lookup()); cmake::MessageType mtype = cmake::LOG; + cmState* state = this->GetCMakeInstance()->GetState(); + do { char inc = *in; @@ -2807,8 +2809,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( value = cmSystemTools::GetEnv(lookup.c_str()); break; case CACHE: - value = this->GetCacheManager() - ->GetInitializedCacheValue(lookup); + value = state->GetCacheEntryValue(lookup); break; } // Get the string we're meant to append to. @@ -3598,7 +3599,7 @@ int cmMakefile::TryCompile(const std::string& srcdir, // Add this before the user-provided CMake arguments in case // one of the arguments is -DCMAKE_BUILD_TYPE=... cm.AddCacheEntry("CMAKE_BUILD_TYPE", config, - "Build configuration", cmCacheManager::STRING); + "Build configuration", cmState::STRING); } } // if cmake args were provided then pass them in @@ -3637,12 +3638,12 @@ int cmMakefile::TryCompile(const std::string& srcdir, if(this->IsOn("CMAKE_SUPPRESS_DEVELOPER_WARNINGS")) { cm.AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", - "TRUE", "", cmCacheManager::INTERNAL); + "TRUE", "", cmState::INTERNAL); } else { cm.AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", - "FALSE", "", cmCacheManager::INTERNAL); + "FALSE", "", cmState::INTERNAL); } if (cm.Configure() != 0) { @@ -3716,9 +3717,9 @@ void cmMakefile::GetListOfMacros(std::string& macros) const macros = cmJoin(this->MacrosList, ";"); } -cmCacheManager *cmMakefile::GetCacheManager() const +cmState *cmMakefile::GetState() const { - return this->GetCMakeInstance()->GetCacheManager(); + return this->GetCMakeInstance()->GetState(); } void cmMakefile::DisplayStatus(const char* message, float s) const @@ -4885,7 +4886,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, if(id == cmPolicies::CMP0001 && (status == cmPolicies::WARN || status == cmPolicies::OLD)) { - if(!(this->GetCacheManager() + if(!(this->GetState() ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))) { // Set it to 2.4 because that is the last version where the @@ -4895,7 +4896,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, "For backwards compatibility, what version of CMake " "commands and " "syntax should this version of CMake try to support.", - cmCacheManager::STRING); + cmState::STRING); } } |