summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2001-05-08 21:04:22 (GMT)
committerKen Martin <ken.martin@kitware.com>2001-05-08 21:04:22 (GMT)
commit36b4fbb1f42c2692ce3be70121b8f81d53a96520 (patch)
tree031b72446e75490780eaef00e87ed6cc082451c8 /Source
parentcdffbea01716b94ebc1fbe36900b5a9694047c55 (diff)
downloadCMake-36b4fbb1f42c2692ce3be70121b8f81d53a96520.zip
CMake-36b4fbb1f42c2692ce3be70121b8f81d53a96520.tar.gz
CMake-36b4fbb1f42c2692ce3be70121b8f81d53a96520.tar.bz2
added ability to load another cache
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCacheManager.cxx13
-rw-r--r--Source/cmCacheManager.h1
2 files changed, 12 insertions, 2 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 7582f37..cbc72ef 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -90,6 +90,11 @@ bool cmCacheManager::LoadCache(cmMakefile* mf)
bool cmCacheManager::LoadCache(const char* path)
{
+ this->LoadCache(path,true);
+}
+bool cmCacheManager::LoadCache(const char* path,
+ bool internal)
+{
std::string cacheFile = path;
cacheFile += "/CMakeCache.txt";
// clear the old cache
@@ -125,8 +130,12 @@ bool cmCacheManager::LoadCache(const char* path)
if(reg.find(buffer))
{
e.m_Type = cmCacheManager::StringToType(reg.match(2).c_str());
- e.m_Value = reg.match(3);
- m_Cache[reg.match(1)] = e;
+ // only load internal values if internal is set
+ if (internal || e.m_Type != INTERNAL)
+ {
+ e.m_Value = reg.match(3);
+ m_Cache[reg.match(1)] = e;
+ }
}
else
{
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index 6ecb37b..edb18a8 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -78,6 +78,7 @@ public:
bool LoadCache(cmMakefile*);
//! Load a cache for given makefile. Loads from path/CMakeCache.txt.
bool LoadCache(const char* path);
+ bool LoadCache(const char* path, bool internal);
//! Put cache definitions into makefile
void DefineCache(cmMakefile*);