summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-03-13 14:53:47 (GMT)
committerBrad King <brad.king@kitware.com>2009-03-13 14:53:47 (GMT)
commit5e49dc4346c276ada7bea1376266e8fb2956b78c (patch)
tree6732a1dbe3c8042ccd6a08a82e1e4804056b27a6 /Source
parentc6d0043e2a256d1785cb4b9f6497e578f7eaed19 (diff)
downloadCMake-5e49dc4346c276ada7bea1376266e8fb2956b78c.zip
CMake-5e49dc4346c276ada7bea1376266e8fb2956b78c.tar.gz
CMake-5e49dc4346c276ada7bea1376266e8fb2956b78c.tar.bz2
BUG: Fix cache properties for CMAKE_STRICT build
All cmPropertyMap instances must have CMakeInstance set. This teaches cmCacheManager to set it on cache entries.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCacheManager.cxx6
-rw-r--r--Source/cmCacheManager.h4
-rw-r--r--Source/cmake.cxx2
3 files changed, 9 insertions, 3 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index a263bcf..c3e577c 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -42,10 +42,11 @@ const char* cmCacheManagerTypes[] =
0
};
-cmCacheManager::cmCacheManager()
+cmCacheManager::cmCacheManager(cmake* cm)
{
this->CacheMajorVersion = 0;
this->CacheMinorVersion = 0;
+ this->CMakeInstance = cm;
}
const char* cmCacheManager::TypeToString(cmCacheManager::CacheEntryType type)
@@ -226,6 +227,7 @@ bool cmCacheManager::LoadCache(const char* path,
// Format is key:type=value
std::string helpString;
CacheEntry e;
+ e.Properties.SetCMakeInstance(this->CMakeInstance);
cmSystemTools::GetLineFromStream(fin, buffer);
realbuffer = buffer.c_str();
while(*realbuffer != '0' &&
@@ -384,6 +386,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey,
{
// Create an entry and store the property.
CacheEntry& ne = this->Cache[key];
+ ne.Properties.SetCMakeInstance(this->CMakeInstance);
ne.Type = cmCacheManager::UNINITIALIZED;
ne.SetProperty(*p, e.Value.c_str());
}
@@ -724,6 +727,7 @@ void cmCacheManager::AddCacheEntry(const char* key,
CacheEntryType type)
{
CacheEntry& e = this->Cache[key];
+ e.Properties.SetCMakeInstance(this->CMakeInstance);
if ( value )
{
e.Value = value;
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index 4d7254d..2ac6994 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -21,6 +21,7 @@
#include "cmPropertyMap.h"
class cmMakefile;
class cmMarkAsAdvancedCommand;
+class cmake;
/** \class cmCacheManager
* \brief Control class for cmake's cache
@@ -31,7 +32,7 @@ class cmMarkAsAdvancedCommand;
class cmCacheManager
{
public:
- cmCacheManager();
+ cmCacheManager(cmake* cm);
class CacheIterator;
friend class cmCacheManager::CacheIterator;
enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC,
@@ -175,6 +176,7 @@ protected:
unsigned int CacheMajorVersion;
unsigned int CacheMinorVersion;
private:
+ cmake* CMakeInstance;
typedef std::map<cmStdString, CacheEntry> CacheEntryMap;
static void OutputHelpString(std::ostream& fout,
const std::string& helpString);
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 825fe63..5cabc22 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -176,7 +176,7 @@ cmake::cmake()
this->Verbose = false;
this->InTryCompile = false;
- this->CacheManager = new cmCacheManager;
+ this->CacheManager = new cmCacheManager(this);
this->GlobalGenerator = 0;
this->ProgressCallback = 0;
this->ProgressCallbackClientData = 0;