added ability to load another cache

This commit is contained in:
Ken Martin 2001-05-08 17:04:22 -04:00
parent cdffbea017
commit 36b4fbb1f4
2 changed files with 12 additions and 2 deletions

View File

@ -89,6 +89,11 @@ bool cmCacheManager::LoadCache(cmMakefile* mf)
bool cmCacheManager::LoadCache(const char* path) bool cmCacheManager::LoadCache(const char* path)
{
this->LoadCache(path,true);
}
bool cmCacheManager::LoadCache(const char* path,
bool internal)
{ {
std::string cacheFile = path; std::string cacheFile = path;
cacheFile += "/CMakeCache.txt"; cacheFile += "/CMakeCache.txt";
@ -125,8 +130,12 @@ bool cmCacheManager::LoadCache(const char* path)
if(reg.find(buffer)) if(reg.find(buffer))
{ {
e.m_Type = cmCacheManager::StringToType(reg.match(2).c_str()); e.m_Type = cmCacheManager::StringToType(reg.match(2).c_str());
e.m_Value = reg.match(3); // only load internal values if internal is set
m_Cache[reg.match(1)] = e; if (internal || e.m_Type != INTERNAL)
{
e.m_Value = reg.match(3);
m_Cache[reg.match(1)] = e;
}
} }
else else
{ {

View File

@ -78,6 +78,7 @@ public:
bool LoadCache(cmMakefile*); bool LoadCache(cmMakefile*);
//! Load a cache for given makefile. Loads from path/CMakeCache.txt. //! Load a cache for given makefile. Loads from path/CMakeCache.txt.
bool LoadCache(const char* path); bool LoadCache(const char* path);
bool LoadCache(const char* path, bool internal);
//! Put cache definitions into makefile //! Put cache definitions into makefile
void DefineCache(cmMakefile*); void DefineCache(cmMakefile*);