MCPcopy Create free account
hub / github.com/Kitware/CMake / AddCacheEntry

Method AddCacheEntry

Source/cmCacheManager.cxx:526–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524}
525
526void cmCacheManager::AddCacheEntry(std::string const& key, cmValue value,
527 cmValue helpString,
528 cmStateEnums::CacheEntryType type)
529{
530 CacheEntry& e = this->Cache[key];
531 e.SetValue(value);
532 e.Type = type;
533 // make sure we only use unix style paths
534 if (type == cmStateEnums::FILEPATH || type == cmStateEnums::PATH) {
535 if (e.Value.find(';') != std::string::npos) {
536 cmList paths{ e.Value };
537 for (std::string& i : paths) {
538 cmSystemTools::ConvertToUnixSlashes(i);
539 }
540 e.Value = paths.to_string();
541 } else {
542 cmSystemTools::ConvertToUnixSlashes(e.Value);
543 }
544 }
545 e.SetProperty(
546 "HELPSTRING",
547 helpString ? *helpString
548 : std::string{
549 "(This variable does not exist and should not be used)" });
550}
551
552void cmCacheManager::CacheEntry::SetValue(cmValue value)
553{

Callers 2

LoadCacheMethod · 0.95
SaveCacheMethod · 0.95

Calls 4

to_stringMethod · 0.80
SetValueMethod · 0.45
findMethod · 0.45
SetPropertyMethod · 0.45

Tested by

no test coverage detected