3
3
Program: CMake - Cross-Platform Makefile Generator
4
4
Module: $RCSfile: cmCacheManager.cxx,v $
6
Date: $Date: 2005/08/11 18:02:19 $
7
Version: $Revision: 1.85.2.1 $
6
Date: $Date: 2006/05/11 02:15:08 $
7
Version: $Revision: 1.92.2.1 $
9
9
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10
10
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12
This software is distributed WITHOUT ANY WARRANTY; without even
13
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12
This software is distributed WITHOUT ANY WARRANTY; without even
13
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14
14
PURPOSE. See the above copyright notices for more information.
16
16
=========================================================================*/
20
20
#include "cmCacheManager.h"
21
21
#include "cmMakefile.h"
23
#include <cmsys/Directory.hxx>
24
#include <cmsys/Glob.hxx>
23
26
#include <cmsys/RegularExpression.hxx>
25
28
#if defined(_WIN32) || defined(__CYGWIN__)
26
29
# include <windows.h>
29
const char* cmCacheManagerTypes[] =
32
const char* cmCacheManagerTypes[] =
78
81
return this->LoadCache(path, internal, emptySet, emptySet);
81
bool cmCacheManager::ParseEntry(const char* entry,
84
bool cmCacheManager::ParseEntry(const char* entry,
83
86
std::string& value)
85
88
// input line is: key:type=value
86
static cmsys::RegularExpression reg("^([^:]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
89
static cmsys::RegularExpression reg(
90
"^([^:]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
87
91
// input line is: "key":type=value
88
static cmsys::RegularExpression regQuoted("^\"([^\"]*)\"=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
92
static cmsys::RegularExpression regQuoted(
93
"^\"([^\"]*)\"=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
90
95
if(regQuoted.find(entry))
103
108
// if value is enclosed in single quotes ('foo') then remove them
104
109
// it is used to enclose trailing space or tab
106
111
value.size() >= 2 &&
108
value[value.size() - 1] == '\'')
113
value[value.size() - 1] == '\'')
110
value = value.substr(1,
115
value = value.substr(1,
111
116
value.size() - 2);
117
bool cmCacheManager::ParseEntry(const char* entry,
122
bool cmCacheManager::ParseEntry(const char* entry,
118
123
std::string& var,
119
124
std::string& value,
120
125
CacheEntryType& type)
122
127
// input line is: key:type=value
123
static cmsys::RegularExpression reg("^([^:]*):([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
128
static cmsys::RegularExpression reg(
129
"^([^:]*):([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
124
130
// input line is: "key":type=value
125
static cmsys::RegularExpression regQuoted("^\"([^\"]*)\":([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
131
static cmsys::RegularExpression regQuoted(
132
"^\"([^\"]*)\":([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
126
133
bool flag = false;
127
134
if(regQuoted.find(entry))
142
149
// if value is enclosed in single quotes ('foo') then remove them
143
150
// it is used to enclose trailing space or tab
145
152
value.size() >= 2 &&
147
value[value.size() - 1] == '\'')
154
value[value.size() - 1] == '\'')
149
value = value.substr(1,
156
value = value.substr(1,
150
157
value.size() - 2);
163
void cmCacheManager::CleanCMakeFiles(const char* path)
165
std::string glob = path;
166
glob += "/CMakeFiles/*.cmake";
168
globIt.FindFiles(glob);
169
std::vector<std::string> files = globIt.GetFiles();
170
for(std::vector<std::string>::iterator i = files.begin();
171
i != files.end(); ++i)
173
cmSystemTools::RemoveFile(i->c_str());
156
177
bool cmCacheManager::LoadCache(const char* path,
158
179
std::set<cmStdString>& excludes,
163
184
// clear the old cache, if we are reading in internal values
189
if(!cmSystemTools::FileExists(cacheFile.c_str()))
191
this->CleanCMakeFiles(path);
168
195
std::ifstream fin(cacheFile.c_str());
195
222
while(realbuffer[0] == '/' && realbuffer[1] == '/')
197
e.m_Properties["HELPSTRING"] += &realbuffer[2];
224
e.Properties["HELPSTRING"] += &realbuffer[2];
198
225
cmSystemTools::GetLineFromStream(fin, buffer);
199
226
realbuffer = buffer.c_str();
205
if(cmCacheManager::ParseEntry(realbuffer, entryKey, e.m_Value, e.m_Type))
232
if(cmCacheManager::ParseEntry(realbuffer, entryKey, e.Value, e.Type))
207
234
if ( excludes.find(entryKey) == excludes.end() )
210
237
// If the entry is not internal to the cache being loaded
211
238
// or if it is in the list of internal entries to be
212
239
// imported, load it.
213
if ( internal || (e.m_Type != INTERNAL) ||
240
if ( internal || (e.Type != INTERNAL) ||
214
241
(includes.find(entryKey) != includes.end()) )
216
243
// If we are loading the cache from another project,
218
245
// not visible in the gui
222
e.m_Properties["HELPSTRING"] = "DO NOT EDIT, ";
223
e.m_Properties["HELPSTRING"] += entryKey;
224
e.m_Properties["HELPSTRING"] += " loaded from external file. "
249
e.Properties["HELPSTRING"] = "DO NOT EDIT, ";
250
e.Properties["HELPSTRING"] += entryKey;
251
e.Properties["HELPSTRING"] += " loaded from external file. "
225
252
"To change this value edit this file: ";
226
e.m_Properties["HELPSTRING"] += path;
227
e.m_Properties["HELPSTRING"] += "/CMakeCache.txt" ;
253
e.Properties["HELPSTRING"] += path;
254
e.Properties["HELPSTRING"] += "/CMakeCache.txt" ;
229
if ( e.m_Type == cmCacheManager::INTERNAL &&
256
if ( e.Type == cmCacheManager::INTERNAL &&
230
257
(entryKey.size() > strlen("-ADVANCED")) &&
231
strcmp(entryKey.c_str() + (entryKey.size() - strlen("-ADVANCED")),
258
strcmp(entryKey.c_str() + (entryKey.size() -
259
strlen("-ADVANCED")), "-ADVANCED") == 0 )
234
std::string value = e.m_Value;
235
std::string akey = entryKey.substr(0, (entryKey.size() - strlen("-ADVANCED")));
236
cmCacheManager::CacheIterator it = this->GetCacheIterator(akey.c_str());
261
std::string value = e.Value;
263
entryKey.substr(0, (entryKey.size() - strlen("-ADVANCED")));
264
cmCacheManager::CacheIterator it =
265
this->GetCacheIterator(akey.c_str());
237
266
if ( it.IsAtEnd() )
239
e.m_Type = cmCacheManager::UNINITIALIZED;
268
e.Type = cmCacheManager::UNINITIALIZED;
269
this->Cache[akey] = e;
242
271
if (!it.Find(akey.c_str()))
246
275
it.SetProperty("ADVANCED", value.c_str());
248
else if ( e.m_Type == cmCacheManager::INTERNAL &&
277
else if ( e.Type == cmCacheManager::INTERNAL &&
249
278
(entryKey.size() > strlen("-MODIFIED")) &&
250
strcmp(entryKey.c_str() + (entryKey.size() - strlen("-MODIFIED")),
279
strcmp(entryKey.c_str() + (entryKey.size() -
280
strlen("-MODIFIED")), "-MODIFIED") == 0 )
253
std::string value = e.m_Value;
254
std::string akey = entryKey.substr(0, (entryKey.size() - strlen("-MODIFIED")));
255
cmCacheManager::CacheIterator it = this->GetCacheIterator(akey.c_str());
282
std::string value = e.Value;
284
entryKey.substr(0, (entryKey.size() - strlen("-MODIFIED")));
285
cmCacheManager::CacheIterator it =
286
this->GetCacheIterator(akey.c_str());
256
287
if ( it.IsAtEnd() )
258
e.m_Type = cmCacheManager::UNINITIALIZED;
289
e.Type = cmCacheManager::UNINITIALIZED;
290
this->Cache[akey] = e;
261
292
if (!it.Find(akey.c_str()))
288
319
this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION", "0",
289
320
"Major version of cmake used to create the "
290
321
"current loaded cache", cmCacheManager::INTERNAL);
293
324
// check to make sure the cache directory has not
300
331
currentcwd += "/CMakeCache.txt";
301
332
oldcwd += "/CMakeCache.txt";
302
333
if(!cmSystemTools::SameFile(oldcwd.c_str(), currentcwd.c_str()))
304
std::string message =
335
std::string message =
305
336
std::string("The current CMakeCache.txt directory ") +
306
currentcwd + std::string(" is different than the directory ") +
337
currentcwd + std::string(" is different than the directory ") +
307
338
std::string(this->GetCacheValue("CMAKE_CACHEFILE_DIR")) +
308
339
std::string(" where CMackeCache.txt was created. This may result "
309
340
"in binaries being created in the wrong place. If you "
310
341
"are not sure, reedit the CMakeCache.txt");
311
cmSystemTools::Error(message.c_str());
342
cmSystemTools::Error(message.c_str());
317
bool cmCacheManager::SaveCache(cmMakefile* mf)
348
bool cmCacheManager::SaveCache(cmMakefile* mf)
319
350
return this->SaveCache(mf->GetHomeOutputDirectory());
323
bool cmCacheManager::SaveCache(const char* path)
354
bool cmCacheManager::SaveCache(const char* path)
325
356
std::string cacheFile = path;
326
357
cacheFile += "/CMakeCache.txt";
328
359
tempFile += ".tmp";
329
360
std::ofstream fout(tempFile.c_str());
332
cmSystemTools::Error("Unable to open cache file for save. ",
363
cmSystemTools::Error("Unable to open cache file for save. ",
333
364
cacheFile.c_str());
334
365
cmSystemTools::ReportLastSystemError("");
337
368
// before writing the cache, update the version numbers
340
371
sprintf(temp, "%d", cmMakefile::GetMinorVersion());
341
372
this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION", temp,
346
377
"Major version of cmake used to create the "
347
378
"current loaded cache", cmCacheManager::INTERNAL);
349
this->AddCacheEntry("CMAKE_CACHE_RELEASE_VERSION", cmMakefile::GetReleaseVersion(),
380
this->AddCacheEntry("CMAKE_CACHE_RELEASE_VERSION",
381
cmMakefile::GetReleaseVersion(),
350
382
"Major version of cmake used to create the "
351
383
"current loaded cache", cmCacheManager::INTERNAL);
364
396
" was created", cmCacheManager::INTERNAL);
366
398
fout << "# This is the CMakeCache file.\n"
367
<< "# For build in directory: " << currentcwd << "\n"
368
<< "# You can edit this file to change values found and used by cmake.\n"
369
<< "# If you do not want to change any of the values, simply exit the editor.\n"
370
<< "# If you do want to change a value, simply edit, save, and exit the editor.\n"
399
<< "# For build in directory: " << currentcwd << "\n";
400
cmCacheManager::CacheEntry* cmakeCacheEntry
401
= this->GetCacheEntry("CMAKE_COMMAND");
402
if ( cmakeCacheEntry )
404
fout << "# It was generated by CMake: " <<
405
cmakeCacheEntry->Value << std::endl;
408
fout << "# You can edit this file to change values found and used by cmake."
410
<< "# If you do not want to change any of the values, simply exit the "
411
"editor." << std::endl
412
<< "# If you do want to change a value, simply edit, save, and exit "
413
"the editor." << std::endl
371
414
<< "# The syntax for the file is as follows:\n"
372
415
<< "# KEY:TYPE=VALUE\n"
373
416
<< "# KEY is the name of a variable in the cache.\n"
374
<< "# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.\n"
417
<< "# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT "
418
"TYPE!." << std::endl
375
419
<< "# VALUE is the current value for the KEY.\n\n";
377
421
fout << "########################\n";
379
423
fout << "########################\n";
382
for( std::map<cmStdString, CacheEntry>::const_iterator i = m_Cache.begin();
383
i != m_Cache.end(); ++i)
426
for( std::map<cmStdString, CacheEntry>::const_iterator i =
427
this->Cache.begin(); i != this->Cache.end(); ++i)
385
429
const CacheEntry& ce = (*i).second;
386
CacheEntryType t = ce.m_Type;
387
if(t == cmCacheManager::UNINITIALIZED || !ce.m_Initialized)
430
CacheEntryType t = ce.Type;
431
if(t == cmCacheManager::UNINITIALIZED || !ce.Initialized)
390
434
// This should be added in, but is not for now.
391
cmSystemTools::Error("Cache entry \"", (*i).first.c_str(),
435
cmSystemTools::Error("Cache entry \"", (*i).first.c_str(),
392
436
"\" is uninitialized");
397
441
// Format is key:type=value
398
442
std::map<cmStdString,cmStdString>::const_iterator it =
399
ce.m_Properties.find("HELPSTRING");
400
if ( it == ce.m_Properties.end() )
443
ce.Properties.find("HELPSTRING");
444
if ( it == ce.Properties.end() )
402
446
cmCacheManager::OutputHelpString(fout, "Missing description");
406
450
cmCacheManager::OutputHelpString(fout, it->second);
409
// support : in key name by double quoting
453
// support : in key name by double quoting
410
454
if((*i).first.find(':') != std::string::npos ||
411
455
(*i).first.find("//") == 0)
421
465
fout << key.c_str() << ":"
422
466
<< cmCacheManagerTypes[t] << "=";
423
467
// if value has trailing space or tab, enclose it in single quotes
424
if (ce.m_Value.size() &&
425
(ce.m_Value[ce.m_Value.size() - 1] == ' ' ||
426
ce.m_Value[ce.m_Value.size() - 1] == '\t'))
468
if (ce.Value.size() &&
469
(ce.Value[ce.Value.size() - 1] == ' ' ||
470
ce.Value[ce.Value.size() - 1] == '\t'))
428
fout << '\'' << ce.m_Value << '\'';
472
fout << '\'' << ce.Value << '\'';
463
507
helpstring += i.GetName();
464
508
rkey += "-ADVANCED";
465
509
cmCacheManager::OutputHelpString(fout, helpstring.c_str());
466
// support : in key name by double quoting
510
// support : in key name by double quoting
467
511
if(rkey.find(':') != std::string::npos ||
468
512
rkey.find("//") == 0)
491
535
helpstring += i.GetName();
492
536
rkey += "-MODIFIED";
493
537
cmCacheManager::OutputHelpString(fout, helpstring.c_str());
494
// support : in key name by double quoting
538
// support : in key name by double quoting
495
539
if(rkey.find(':') != std::string::npos ||
496
540
rkey.find("//") == 0)
524
568
cmCacheManager::OutputHelpString(fout, helpstring.c_str());
525
// support : in key name by double quoting
569
// support : in key name by double quoting
526
570
if(rkey.find(':') != std::string::npos ||
527
571
rkey.find("//") == 0)
539
583
// if value has trailing space or tab, enclose it in single quotes
540
584
std::string value = i.GetValue();
541
585
if (value.size() &&
542
(value[value.size() - 1] == ' ' ||
586
(value[value.size() - 1] == ' ' ||
543
587
value[value.size() - 1] == '\t'))
545
589
fout << '\'' << value << '\'';
563
607
std::ofstream checkCache(checkCacheFile.c_str());
566
cmSystemTools::Error("Unable to open check cache file for write. ",
610
cmSystemTools::Error("Unable to open check cache file for write. ",
567
611
checkCacheFile.c_str());
570
checkCache << "# This file is generated by cmake for dependency checking of the CMakeCache.txt file\n";
614
checkCache << "# This file is generated by cmake for dependency checking "
615
"of the CMakeCache.txt file\n";
574
bool cmCacheManager::DeleteCache(const char* path)
619
bool cmCacheManager::DeleteCache(const char* path)
576
621
std::string cacheFile = path;
622
cmSystemTools::ConvertToUnixSlashes(cacheFile);
623
std::string cmakeFiles = cacheFile;
577
624
cacheFile += "/CMakeCache.txt";
578
625
cmSystemTools::RemoveFile(cacheFile.c_str());
626
// now remove the files in the CMakeFiles directory
627
// this cleans up language cache files
628
cmsys::Directory dir;
629
cmakeFiles += "/CMakeFiles";
630
dir.Load(cmakeFiles.c_str());
631
for (unsigned long fileNum = 0;
632
fileNum < dir.GetNumberOfFiles();
636
FileIsDirectory(dir.GetFile(fileNum)))
638
std::string fullPath = cmakeFiles;
640
fullPath += dir.GetFile(fileNum);
641
cmSystemTools::RemoveFile(fullPath.c_str());
582
void cmCacheManager::OutputHelpString(std::ofstream& fout,
647
void cmCacheManager::OutputHelpString(std::ofstream& fout,
583
648
const std::string& helpString)
585
650
std::string::size_type end = helpString.size();
630
695
cmCacheManager::CacheEntry *cmCacheManager::GetCacheEntry(const char* key)
632
CacheEntryMap::iterator i = m_Cache.find(key);
633
if(i != m_Cache.end())
697
CacheEntryMap::iterator i = this->Cache.find(key);
698
if(i != this->Cache.end())
635
700
return &i->second;
640
cmCacheManager::CacheIterator cmCacheManager::GetCacheIterator(const char *key)
705
cmCacheManager::CacheIterator cmCacheManager::GetCacheIterator(
642
708
return CacheIterator(*this, key);
645
711
const char* cmCacheManager::GetCacheValue(const char* key) const
647
CacheEntryMap::const_iterator i = m_Cache.find(key);
648
if(i != m_Cache.end() &&
649
i->second.m_Initialized)
713
CacheEntryMap::const_iterator i = this->Cache.find(key);
714
if(i != this->Cache.end() &&
715
i->second.Initialized)
651
return i->second.m_Value.c_str();
717
return i->second.Value.c_str();
659
725
out << "=================================================" << std::endl;
660
726
out << "CMakeCache Contents:" << std::endl;
661
for(std::map<cmStdString, CacheEntry>::const_iterator i = m_Cache.begin();
662
i != m_Cache.end(); ++i)
727
for(std::map<cmStdString, CacheEntry>::const_iterator i =
728
this->Cache.begin(); i != this->Cache.end(); ++i)
664
if((*i).second.m_Type != INTERNAL)
730
if((*i).second.Type != INTERNAL)
666
out << (*i).first.c_str() << " = " << (*i).second.m_Value.c_str() << std::endl;
732
out << (*i).first.c_str() << " = " << (*i).second.Value.c_str()
670
out << "To change values in the CMakeCache, \nedit CMakeCache.txt in your output directory.\n";
737
out << "To change values in the CMakeCache, "
738
<< std::endl << "edit CMakeCache.txt in your output directory.\n";
671
739
out << "=================================================" << std::endl;
675
void cmCacheManager::AddCacheEntry(const char* key,
743
void cmCacheManager::AddCacheEntry(const char* key,
677
745
const char* helpString,
678
746
CacheEntryType type)
680
CacheEntry& e = m_Cache[key];
748
CacheEntry& e = this->Cache[key];
684
e.m_Initialized = true;
752
e.Initialized = true;
691
759
// make sure we only use unix style paths
692
760
if(type == FILEPATH || type == PATH)
694
cmSystemTools::ConvertToUnixSlashes(e.m_Value);
762
cmSystemTools::ConvertToUnixSlashes(e.Value);
696
764
if ( helpString )
698
e.m_Properties["HELPSTRING"] = helpString;
766
e.Properties["HELPSTRING"] = helpString;
702
e.m_Properties["HELPSTRING"] = "(This variable does not exists and should not be used)";
770
e.Properties["HELPSTRING"] =
771
"(This variable does not exists and should not be used)";
773
this->Cache[key] = e;
707
void cmCacheManager::AddCacheEntry(const char* key, bool v,
776
void cmCacheManager::AddCacheEntry(const char* key, bool v,
708
777
const char* helpString)
720
789
bool cmCacheManager::CacheIterator::IsAtEnd() const
722
return m_Position == m_Container.m_Cache.end();
791
return this->Position == this->Container.Cache.end();
725
void cmCacheManager::CacheIterator::Begin()
794
void cmCacheManager::CacheIterator::Begin()
727
m_Position = m_Container.m_Cache.begin();
796
this->Position = this->Container.Cache.begin();
730
799
bool cmCacheManager::CacheIterator::Find(const char* key)
732
m_Position = m_Container.m_Cache.find(key);
801
this->Position = this->Container.Cache.find(key);
733
802
return !this->IsAtEnd();
736
void cmCacheManager::CacheIterator::Next()
805
void cmCacheManager::CacheIterator::Next()
738
807
if (!this->IsAtEnd())
750
819
CacheEntry* entry = &this->GetEntry();
753
entry->m_Value = value;
754
entry->m_Initialized = true;
822
entry->Value = value;
823
entry->Initialized = true;
762
const char* cmCacheManager::CacheIterator::GetProperty(const char* property) const
831
const char* cmCacheManager::CacheIterator::GetProperty(
832
const char* property) const
764
834
// make sure it is not at the end
765
835
if (this->IsAtEnd())
770
840
if ( !strcmp(property, "TYPE") || !strcmp(property, "VALUE") )
772
cmSystemTools::Error("Property \"", property,
842
cmSystemTools::Error("Property \"", property,
773
843
"\" cannot be accessed through the GetProperty()");
776
846
const CacheEntry* ent = &this->GetEntry();
777
847
std::map<cmStdString,cmStdString>::const_iterator it =
778
ent->m_Properties.find(property);
779
if ( it == ent->m_Properties.end() )
848
ent->Properties.find(property);
849
if ( it == ent->Properties.end() )
783
853
return it->second.c_str();
786
void cmCacheManager::CacheIterator::SetProperty(const char* p, const char* v)
856
void cmCacheManager::CacheIterator::SetProperty(const char* p, const char* v)
788
858
// make sure it is not at the end
789
859
if (this->IsAtEnd())
794
864
if ( !strcmp(p, "TYPE") || !strcmp(p, "VALUE") )
796
cmSystemTools::Error("Property \"", p,
866
cmSystemTools::Error("Property \"", p,
797
867
"\" cannot be accessed through the SetProperty()");
800
870
CacheEntry* ent = &this->GetEntry();
801
ent->m_Properties[p] = v;
871
ent->Properties[p] = v;
804
875
bool cmCacheManager::CacheIterator::GetValueAsBool() const
806
return cmSystemTools::IsOn(this->GetEntry().m_Value.c_str());
877
return cmSystemTools::IsOn(this->GetEntry().Value.c_str());
809
bool cmCacheManager::CacheIterator::GetPropertyAsBool(const char* property) const
880
bool cmCacheManager::CacheIterator::GetPropertyAsBool(
881
const char* property) const
811
883
// make sure it is not at the end
812
884
if (this->IsAtEnd())
817
889
if ( !strcmp(property, "TYPE") || !strcmp(property, "VALUE") )
819
cmSystemTools::Error("Property \"", property,
820
"\" cannot be accessed through the GetPropertyAsBool()");
891
cmSystemTools::Error("Property \"", property,
892
"\" cannot be accessed through the GetPropertyAsBool()");
823
895
const CacheEntry* ent = &this->GetEntry();
824
896
std::map<cmStdString,cmStdString>::const_iterator it =
825
ent->m_Properties.find(property);
826
if ( it == ent->m_Properties.end() )
897
ent->Properties.find(property);
898
if ( it == ent->Properties.end() )
842
914
if ( !strcmp(p, "TYPE") || !strcmp(p, "VALUE") )
844
cmSystemTools::Error("Property \"", p,
916
cmSystemTools::Error("Property \"", p,
845
917
"\" cannot be accessed through the SetProperty()");
848
920
CacheEntry* ent = &this->GetEntry();
849
ent->m_Properties[p] = v ? "ON" : "OFF";
921
ent->Properties[p] = v ? "ON" : "OFF";
852
924
bool cmCacheManager::CacheIterator::PropertyExists(const char* property) const
860
932
if ( !strcmp(property, "TYPE") || !strcmp(property, "VALUE") )
862
cmSystemTools::Error("Property \"", property,
863
"\" cannot be accessed through the PropertyExists()");
934
cmSystemTools::Error("Property \"", property,
935
"\" cannot be accessed through the PropertyExists()");
866
938
const CacheEntry* ent = &this->GetEntry();
867
939
std::map<cmStdString,cmStdString>::const_iterator it =
868
ent->m_Properties.find(property);
869
if ( it == ent->m_Properties.end() )
940
ent->Properties.find(property);
941
if ( it == ent->Properties.end() )