1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCacheManager.cxx,v $
6 Date: $Date: 2007-09-07 15:10:46 $
7 Version: $Revision: 1.98 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
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
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
18 #include "cmCacheManager.h"
19 #include "cmSystemTools.h"
20 #include "cmCacheManager.h"
21 #include "cmMakefile.h"
23 #include "cmVersion.h"
25 #include <cmsys/Directory.hxx>
26 #include <cmsys/Glob.hxx>
28 #include <cmsys/RegularExpression.hxx>
30 #if defined(_WIN32) || defined(__CYGWIN__)
34 const char* cmCacheManagerTypes
[] =
45 const char* cmCacheManager::TypeToString(cmCacheManager::CacheEntryType type
)
49 return cmCacheManagerTypes
[6];
51 return cmCacheManagerTypes
[type
];
54 cmCacheManager::CacheEntryType
cmCacheManager::StringToType(const char* s
)
57 while(cmCacheManagerTypes
[i
])
59 if(strcmp(s
, cmCacheManagerTypes
[i
]) == 0)
61 return static_cast<CacheEntryType
>(i
);
68 bool cmCacheManager::LoadCache(cmMakefile
* mf
)
70 return this->LoadCache(mf
->GetHomeOutputDirectory());
74 bool cmCacheManager::LoadCache(const char* path
)
76 return this->LoadCache(path
,true);
79 bool cmCacheManager::LoadCache(const char* path
,
82 std::set
<cmStdString
> emptySet
;
83 return this->LoadCache(path
, internal
, emptySet
, emptySet
);
86 bool cmCacheManager::ParseEntry(const char* entry
,
90 // input line is: key:type=value
91 static cmsys::RegularExpression
reg(
92 "^([^:]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
93 // input line is: "key":type=value
94 static cmsys::RegularExpression
regQuoted(
95 "^\"([^\"]*)\"=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
97 if(regQuoted
.find(entry
))
99 var
= regQuoted
.match(1);
100 value
= regQuoted
.match(2);
103 else if (reg
.find(entry
))
106 value
= reg
.match(2);
110 // if value is enclosed in single quotes ('foo') then remove them
111 // it is used to enclose trailing space or tab
115 value
[value
.size() - 1] == '\'')
117 value
= value
.substr(1,
124 bool cmCacheManager::ParseEntry(const char* entry
,
127 CacheEntryType
& type
)
129 // input line is: key:type=value
130 static cmsys::RegularExpression
reg(
131 "^([^:]*):([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
132 // input line is: "key":type=value
133 static cmsys::RegularExpression
regQuoted(
134 "^\"([^\"]*)\":([^=]*)=(.*[^\r\t ]|[\r\t ]*)[\r\t ]*$");
136 if(regQuoted
.find(entry
))
138 var
= regQuoted
.match(1);
139 type
= cmCacheManager::StringToType(regQuoted
.match(2).c_str());
140 value
= regQuoted
.match(3);
143 else if (reg
.find(entry
))
146 type
= cmCacheManager::StringToType(reg
.match(2).c_str());
147 value
= reg
.match(3);
151 // if value is enclosed in single quotes ('foo') then remove them
152 // it is used to enclose trailing space or tab
156 value
[value
.size() - 1] == '\'')
158 value
= value
.substr(1,
165 void cmCacheManager::CleanCMakeFiles(const char* path
)
167 std::string glob
= path
;
168 glob
+= cmake::GetCMakeFilesDirectory();
171 globIt
.FindFiles(glob
);
172 std::vector
<std::string
> files
= globIt
.GetFiles();
173 for(std::vector
<std::string
>::iterator i
= files
.begin();
174 i
!= files
.end(); ++i
)
176 cmSystemTools::RemoveFile(i
->c_str());
180 bool cmCacheManager::LoadCache(const char* path
,
182 std::set
<cmStdString
>& excludes
,
183 std::set
<cmStdString
>& includes
)
185 std::string cacheFile
= path
;
186 cacheFile
+= "/CMakeCache.txt";
187 // clear the old cache, if we are reading in internal values
192 if(!cmSystemTools::FileExists(cacheFile
.c_str()))
194 this->CleanCMakeFiles(path
);
198 std::ifstream
fin(cacheFile
.c_str());
203 const char *realbuffer
;
205 std::string entryKey
;
208 // Format is key:type=value
210 cmSystemTools::GetLineFromStream(fin
, buffer
);
211 realbuffer
= buffer
.c_str();
212 while(*realbuffer
!= '0' &&
213 (*realbuffer
== ' ' ||
214 *realbuffer
== '\t' ||
215 *realbuffer
== '\r' ||
216 *realbuffer
== '\n'))
220 // skip blank lines and comment lines
221 if(realbuffer
[0] == '#' || realbuffer
[0] == 0)
225 while(realbuffer
[0] == '/' && realbuffer
[1] == '/')
227 if ((realbuffer
[2] == '\\') && (realbuffer
[3]=='n'))
229 e
.Properties
["HELPSTRING"] += "\n";
230 e
.Properties
["HELPSTRING"] += &realbuffer
[4];
234 e
.Properties
["HELPSTRING"] += &realbuffer
[2];
236 cmSystemTools::GetLineFromStream(fin
, buffer
);
237 realbuffer
= buffer
.c_str();
243 if(cmCacheManager::ParseEntry(realbuffer
, entryKey
, e
.Value
, e
.Type
))
245 if ( excludes
.find(entryKey
) == excludes
.end() )
247 // Load internal values if internal is set.
248 // If the entry is not internal to the cache being loaded
249 // or if it is in the list of internal entries to be
250 // imported, load it.
251 if ( internal
|| (e
.Type
!= INTERNAL
) ||
252 (includes
.find(entryKey
) != includes
.end()) )
254 // If we are loading the cache from another project,
255 // make all loaded entries internal so that it is
256 // not visible in the gui
260 e
.Properties
["HELPSTRING"] = "DO NOT EDIT, ";
261 e
.Properties
["HELPSTRING"] += entryKey
;
262 e
.Properties
["HELPSTRING"] += " loaded from external file. "
263 "To change this value edit this file: ";
264 e
.Properties
["HELPSTRING"] += path
;
265 e
.Properties
["HELPSTRING"] += "/CMakeCache.txt" ;
267 if ( e
.Type
== cmCacheManager::INTERNAL
&&
268 (entryKey
.size() > strlen("-ADVANCED")) &&
269 strcmp(entryKey
.c_str() + (entryKey
.size() -
270 strlen("-ADVANCED")), "-ADVANCED") == 0 )
272 std::string value
= e
.Value
;
274 entryKey
.substr(0, (entryKey
.size() - strlen("-ADVANCED")));
275 cmCacheManager::CacheIterator it
=
276 this->GetCacheIterator(akey
.c_str());
279 e
.Type
= cmCacheManager::UNINITIALIZED
;
280 this->Cache
[akey
] = e
;
282 if (!it
.Find(akey
.c_str()))
284 cmSystemTools::Error("Internal CMake error when reading cache");
286 it
.SetProperty("ADVANCED", value
.c_str());
288 else if ( e
.Type
== cmCacheManager::INTERNAL
&&
289 (entryKey
.size() > strlen("-MODIFIED")) &&
290 strcmp(entryKey
.c_str() + (entryKey
.size() -
291 strlen("-MODIFIED")), "-MODIFIED") == 0 )
293 std::string value
= e
.Value
;
295 entryKey
.substr(0, (entryKey
.size() - strlen("-MODIFIED")));
296 cmCacheManager::CacheIterator it
=
297 this->GetCacheIterator(akey
.c_str());
300 e
.Type
= cmCacheManager::UNINITIALIZED
;
301 this->Cache
[akey
] = e
;
303 if (!it
.Find(akey
.c_str()))
305 cmSystemTools::Error("Internal CMake error when reading cache");
307 it
.SetProperty("MODIFIED", value
.c_str());
311 e
.Initialized
= true;
312 this->Cache
[entryKey
] = e
;
319 cmSystemTools::Error("Parse error in cache file ", cacheFile
.c_str(),
320 ". Offending entry: ", realbuffer
);
323 // if CMAKE version not found in the list file
324 // add them as version 0.0
325 if(!this->GetCacheValue("CMAKE_CACHE_MINOR_VERSION"))
327 this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION", "0",
328 "Minor version of cmake used to create the "
329 "current loaded cache", cmCacheManager::INTERNAL
);
330 this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION", "0",
331 "Major version of cmake used to create the "
332 "current loaded cache", cmCacheManager::INTERNAL
);
335 // check to make sure the cache directory has not
337 if ( internal
&& this->GetCacheValue("CMAKE_CACHEFILE_DIR") )
339 std::string currentcwd
= path
;
340 std::string oldcwd
= this->GetCacheValue("CMAKE_CACHEFILE_DIR");
341 cmSystemTools::ConvertToUnixSlashes(currentcwd
);
342 currentcwd
+= "/CMakeCache.txt";
343 oldcwd
+= "/CMakeCache.txt";
344 if(!cmSystemTools::SameFile(oldcwd
.c_str(), currentcwd
.c_str()))
346 std::string message
=
347 std::string("The current CMakeCache.txt directory ") +
348 currentcwd
+ std::string(" is different than the directory ") +
349 std::string(this->GetCacheValue("CMAKE_CACHEFILE_DIR")) +
350 std::string(" where CMackeCache.txt was created. This may result "
351 "in binaries being created in the wrong place. If you "
352 "are not sure, reedit the CMakeCache.txt");
353 cmSystemTools::Error(message
.c_str());
359 bool cmCacheManager::SaveCache(cmMakefile
* mf
)
361 return this->SaveCache(mf
->GetHomeOutputDirectory());
365 bool cmCacheManager::SaveCache(const char* path
)
367 std::string cacheFile
= path
;
368 cacheFile
+= "/CMakeCache.txt";
369 std::string tempFile
= cacheFile
;
371 std::ofstream
fout(tempFile
.c_str());
374 cmSystemTools::Error("Unable to open cache file for save. ",
376 cmSystemTools::ReportLastSystemError("");
379 // before writing the cache, update the version numbers
382 sprintf(temp
, "%d", cmVersion::GetMinorVersion());
383 this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION", temp
,
384 "Minor version of cmake used to create the "
385 "current loaded cache", cmCacheManager::INTERNAL
);
386 sprintf(temp
, "%d", cmVersion::GetMajorVersion());
387 this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION", temp
,
388 "Major version of cmake used to create the "
389 "current loaded cache", cmCacheManager::INTERNAL
);
391 this->AddCacheEntry("CMAKE_CACHE_RELEASE_VERSION",
392 cmVersion::GetReleaseVersion().c_str(),
393 "Major version of cmake used to create the "
394 "current loaded cache", cmCacheManager::INTERNAL
);
396 // Let us store the current working directory so that if somebody
397 // Copies it, he will not be surprised
398 std::string currentcwd
= path
;
399 if ( currentcwd
[0] >= 'A' && currentcwd
[0] <= 'Z' &&
400 currentcwd
[1] == ':' )
402 currentcwd
[0] = currentcwd
[0] - 'A' + 'a';
404 cmSystemTools::ConvertToUnixSlashes(currentcwd
);
405 this->AddCacheEntry("CMAKE_CACHEFILE_DIR", currentcwd
.c_str(),
406 "This is the directory where this CMakeCahe.txt"
407 " was created", cmCacheManager::INTERNAL
);
409 fout
<< "# This is the CMakeCache file.\n"
410 << "# For build in directory: " << currentcwd
<< "\n";
411 cmCacheManager::CacheEntry
* cmakeCacheEntry
412 = this->GetCacheEntry("CMAKE_COMMAND");
413 if ( cmakeCacheEntry
)
415 fout
<< "# It was generated by CMake: " <<
416 cmakeCacheEntry
->Value
<< std::endl
;
419 fout
<< "# You can edit this file to change values found and used by cmake."
421 << "# If you do not want to change any of the values, simply exit the "
422 "editor." << std::endl
423 << "# If you do want to change a value, simply edit, save, and exit "
424 "the editor." << std::endl
425 << "# The syntax for the file is as follows:\n"
426 << "# KEY:TYPE=VALUE\n"
427 << "# KEY is the name of a variable in the cache.\n"
428 << "# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT "
429 "TYPE!." << std::endl
430 << "# VALUE is the current value for the KEY.\n\n";
432 fout
<< "########################\n";
433 fout
<< "# EXTERNAL cache entries\n";
434 fout
<< "########################\n";
437 for( std::map
<cmStdString
, CacheEntry
>::const_iterator i
=
438 this->Cache
.begin(); i
!= this->Cache
.end(); ++i
)
440 const CacheEntry
& ce
= (*i
).second
;
441 CacheEntryType t
= ce
.Type
;
445 // This should be added in, but is not for now.
446 cmSystemTools::Error("Cache entry \"", (*i).first.c_str(),
447 "\" is uninitialized");
450 else if(t
!= INTERNAL
)
452 // Format is key:type=value
453 std::map
<cmStdString
,cmStdString
>::const_iterator it
=
454 ce
.Properties
.find("HELPSTRING");
455 if ( it
== ce
.Properties
.end() )
457 cmCacheManager::OutputHelpString(fout
, "Missing description");
461 cmCacheManager::OutputHelpString(fout
, it
->second
);
464 // support : in key name by double quoting
465 if((*i
).first
.find(':') != std::string::npos
||
466 (*i
).first
.find("//") == 0)
476 fout
<< key
.c_str() << ":"
477 << cmCacheManagerTypes
[t
] << "=";
478 // if value has trailing space or tab, enclose it in single quotes
479 if (ce
.Value
.size() &&
480 (ce
.Value
[ce
.Value
.size() - 1] == ' ' ||
481 ce
.Value
[ce
.Value
.size() - 1] == '\t'))
483 fout
<< '\'' << ce
.Value
<< '\'';
494 fout
<< "########################\n";
495 fout
<< "# INTERNAL cache entries\n";
496 fout
<< "########################\n";
499 for( cmCacheManager::CacheIterator i
= this->NewIterator();
500 !i
.IsAtEnd(); i
.Next())
502 if ( !i
.Initialized() )
507 CacheEntryType t
= i
.GetType();
508 bool advanced
= i
.PropertyExists("ADVANCED");
511 // Format is key:type=value
513 std::string rkey
= i
.GetName();
514 std::string helpstring
;
515 // If this is advanced variable, we have to do some magic for
516 // backward compatibility
517 helpstring
= "Advanced flag for variable: ";
518 helpstring
+= i
.GetName();
520 cmCacheManager::OutputHelpString(fout
, helpstring
.c_str());
521 // support : in key name by double quoting
522 if(rkey
.find(':') != std::string::npos
||
523 rkey
.find("//") == 0)
533 fout
<< key
.c_str() << ":INTERNAL="
534 << (i
.GetPropertyAsBool("ADVANCED") ? "1" : "0") << "\n";
536 bool modified
= i
.PropertyExists("MODIFIED");
539 // Format is key:type=value
541 std::string rkey
= i
.GetName();
542 std::string helpstring
;
543 // If this is advanced variable, we have to do some magic for
544 // backward compatibility
545 helpstring
= "Modified flag for variable: ";
546 helpstring
+= i
.GetName();
548 cmCacheManager::OutputHelpString(fout
, helpstring
.c_str());
549 // support : in key name by double quoting
550 if(rkey
.find(':') != std::string::npos
||
551 rkey
.find("//") == 0)
561 fout
<< key
.c_str() << ":INTERNAL="
562 << (i
.GetPropertyAsBool("MODIFIED") ? "1" : "0") << "\n";
564 if(t
== cmCacheManager::INTERNAL
)
566 // Format is key:type=value
568 std::string rkey
= i
.GetName();
569 std::string helpstring
;
570 const char* hs
= i
.GetProperty("HELPSTRING");
573 helpstring
= i
.GetProperty("HELPSTRING");
579 cmCacheManager::OutputHelpString(fout
, helpstring
.c_str());
580 // support : in key name by double quoting
581 if(rkey
.find(':') != std::string::npos
||
582 rkey
.find("//") == 0)
592 fout
<< key
.c_str() << ":"
593 << cmCacheManagerTypes
[t
] << "=";
594 // if value has trailing space or tab, enclose it in single quotes
595 std::string value
= i
.GetValue();
597 (value
[value
.size() - 1] == ' ' ||
598 value
[value
.size() - 1] == '\t'))
600 fout
<< '\'' << value
<< '\'';
611 cmSystemTools::CopyFileIfDifferent(tempFile
.c_str(),
613 cmSystemTools::RemoveFile(tempFile
.c_str());
614 std::string checkCacheFile
= path
;
615 checkCacheFile
+= cmake::GetCMakeFilesDirectory();
616 cmSystemTools::MakeDirectory(checkCacheFile
.c_str());
617 checkCacheFile
+= "/cmake.check_cache";
618 std::ofstream
checkCache(checkCacheFile
.c_str());
621 cmSystemTools::Error("Unable to open check cache file for write. ",
622 checkCacheFile
.c_str());
625 checkCache
<< "# This file is generated by cmake for dependency checking "
626 "of the CMakeCache.txt file\n";
630 bool cmCacheManager::DeleteCache(const char* path
)
632 std::string cacheFile
= path
;
633 cmSystemTools::ConvertToUnixSlashes(cacheFile
);
634 std::string cmakeFiles
= cacheFile
;
635 cacheFile
+= "/CMakeCache.txt";
636 cmSystemTools::RemoveFile(cacheFile
.c_str());
637 // now remove the files in the CMakeFiles directory
638 // this cleans up language cache files
639 cmsys::Directory dir
;
640 cmakeFiles
+= cmake::GetCMakeFilesDirectory();
641 dir
.Load(cmakeFiles
.c_str());
642 for (unsigned long fileNum
= 0;
643 fileNum
< dir
.GetNumberOfFiles();
647 FileIsDirectory(dir
.GetFile(fileNum
)))
649 std::string fullPath
= cmakeFiles
;
651 fullPath
+= dir
.GetFile(fileNum
);
652 cmSystemTools::RemoveFile(fullPath
.c_str());
658 void cmCacheManager::OutputHelpString(std::ofstream
& fout
,
659 const std::string
& helpString
)
661 std::string::size_type end
= helpString
.size();
667 std::string::size_type pos
= 0;
668 for (std::string::size_type i
=0; i
<=end
; i
++)
671 || (helpString
[i
]=='\n')
672 || ((i
-pos
>= 60) && (helpString
[i
]==' ')))
675 if (helpString
[pos
] == '\n')
680 oneLine
= helpString
.substr(pos
, i
- pos
);
681 fout
<< oneLine
.c_str() << "\n";
687 void cmCacheManager::RemoveCacheEntry(const char* key
)
689 CacheEntryMap::iterator i
= this->Cache
.find(key
);
690 if(i
!= this->Cache
.end())
692 this->Cache
.erase(i
);
696 std::cerr
<< "Failed to remove entry:" << key
<< std::endl
;
701 cmCacheManager::CacheEntry
*cmCacheManager::GetCacheEntry(const char* key
)
703 CacheEntryMap::iterator i
= this->Cache
.find(key
);
704 if(i
!= this->Cache
.end())
711 cmCacheManager::CacheIterator
cmCacheManager::GetCacheIterator(
714 return CacheIterator(*this, key
);
717 const char* cmCacheManager::GetCacheValue(const char* key
) const
719 CacheEntryMap::const_iterator i
= this->Cache
.find(key
);
720 if(i
!= this->Cache
.end() &&
721 i
->second
.Initialized
)
723 return i
->second
.Value
.c_str();
729 void cmCacheManager::PrintCache(std::ostream
& out
) const
731 out
<< "=================================================" << std::endl
;
732 out
<< "CMakeCache Contents:" << std::endl
;
733 for(std::map
<cmStdString
, CacheEntry
>::const_iterator i
=
734 this->Cache
.begin(); i
!= this->Cache
.end(); ++i
)
736 if((*i
).second
.Type
!= INTERNAL
)
738 out
<< (*i
).first
.c_str() << " = " << (*i
).second
.Value
.c_str()
743 out
<< "To change values in the CMakeCache, "
744 << std::endl
<< "edit CMakeCache.txt in your output directory.\n";
745 out
<< "=================================================" << std::endl
;
749 void cmCacheManager::AddCacheEntry(const char* key
,
751 const char* helpString
,
754 CacheEntry
& e
= this->Cache
[key
];
758 e
.Initialized
= true;
765 // make sure we only use unix style paths
766 if(type
== FILEPATH
|| type
== PATH
)
768 cmSystemTools::ConvertToUnixSlashes(e
.Value
);
772 e
.Properties
["HELPSTRING"] = helpString
;
776 e
.Properties
["HELPSTRING"] =
777 "(This variable does not exist and should not be used)";
779 this->Cache
[key
] = e
;
782 void cmCacheManager::AddCacheEntry(const char* key
, bool v
,
783 const char* helpString
)
787 this->AddCacheEntry(key
, "ON", helpString
, cmCacheManager::BOOL
);
791 this->AddCacheEntry(key
, "OFF", helpString
, cmCacheManager::BOOL
);
795 bool cmCacheManager::CacheIterator::IsAtEnd() const
797 return this->Position
== this->Container
.Cache
.end();
800 void cmCacheManager::CacheIterator::Begin()
802 this->Position
= this->Container
.Cache
.begin();
805 bool cmCacheManager::CacheIterator::Find(const char* key
)
807 this->Position
= this->Container
.Cache
.find(key
);
808 return !this->IsAtEnd();
811 void cmCacheManager::CacheIterator::Next()
813 if (!this->IsAtEnd())
819 void cmCacheManager::CacheIterator::SetValue(const char* value
)
825 CacheEntry
* entry
= &this->GetEntry();
828 entry
->Value
= value
;
829 entry
->Initialized
= true;
837 const char* cmCacheManager::CacheIterator::GetProperty(
838 const char* property
) const
840 // make sure it is not at the end
846 if ( !strcmp(property
, "TYPE") || !strcmp(property
, "VALUE") )
848 cmSystemTools::Error("Property \"", property
,
849 "\" cannot be accessed through the GetProperty()");
852 const CacheEntry
* ent
= &this->GetEntry();
853 std::map
<cmStdString
,cmStdString
>::const_iterator it
=
854 ent
->Properties
.find(property
);
855 if ( it
== ent
->Properties
.end() )
859 return it
->second
.c_str();
862 void cmCacheManager::CacheIterator::SetProperty(const char* p
, const char* v
)
864 // make sure it is not at the end
870 if ( !strcmp(p
, "TYPE") || !strcmp(p
, "VALUE") )
872 cmSystemTools::Error("Property \"", p
,
873 "\" cannot be accessed through the SetProperty()");
876 CacheEntry
* ent
= &this->GetEntry();
877 ent
->Properties
[p
] = v
;
881 bool cmCacheManager::CacheIterator::GetValueAsBool() const
883 return cmSystemTools::IsOn(this->GetEntry().Value
.c_str());
886 bool cmCacheManager::CacheIterator::GetPropertyAsBool(
887 const char* property
) const
889 // make sure it is not at the end
895 if ( !strcmp(property
, "TYPE") || !strcmp(property
, "VALUE") )
897 cmSystemTools::Error("Property \"", property
,
898 "\" cannot be accessed through the GetPropertyAsBool()");
901 const CacheEntry
* ent
= &this->GetEntry();
902 std::map
<cmStdString
,cmStdString
>::const_iterator it
=
903 ent
->Properties
.find(property
);
904 if ( it
== ent
->Properties
.end() )
908 return cmSystemTools::IsOn(it
->second
.c_str());
912 void cmCacheManager::CacheIterator::SetProperty(const char* p
, bool v
)
914 // make sure it is not at the end
920 if ( !strcmp(p
, "TYPE") || !strcmp(p
, "VALUE") )
922 cmSystemTools::Error("Property \"", p
,
923 "\" cannot be accessed through the SetProperty()");
926 CacheEntry
* ent
= &this->GetEntry();
927 ent
->Properties
[p
] = v
? "ON" : "OFF";
930 bool cmCacheManager::CacheIterator::PropertyExists(const char* property
) const
932 // make sure it is not at the end
938 if ( !strcmp(property
, "TYPE") || !strcmp(property
, "VALUE") )
940 cmSystemTools::Error("Property \"", property
,
941 "\" cannot be accessed through the PropertyExists()");
944 const CacheEntry
* ent
= &this->GetEntry();
945 std::map
<cmStdString
,cmStdString
>::const_iterator it
=
946 ent
->Properties
.find(property
);
947 if ( it
== ent
->Properties
.end() )