浏览代码

FIX: only clear the cache on a load when the load needs to read internal values. Otherwise, it is assumed that we are reading another projects cache.

Jim Miller 24 年之前
父节点
当前提交
4d2e6c8394
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      Source/cmCacheManager.cxx

+ 5 - 2
Source/cmCacheManager.cxx

@@ -97,8 +97,11 @@ bool cmCacheManager::LoadCache(const char* path,
 {
   std::string cacheFile = path;
   cacheFile += "/CMakeCache.txt";
-  // clear the old cache
-  m_Cache.clear();
+  // clear the old cache, if we are reading in internal values
+  if ( internal )
+    {
+    m_Cache.clear();
+    }
   std::ifstream fin(cacheFile.c_str());
   if(!fin)
     {