cmPropertyMap: Remove scope parameter from API where not used.

This commit is contained in:
Stephen Kelly 2015-06-06 09:41:15 +02:00
parent 9058e27a43
commit 7c0aa672fe
9 changed files with 22 additions and 35 deletions

View File

@ -662,7 +662,7 @@ void CCONV cmSourceFileSetProperty(void *arg,const char *prop,
else if(prop) else if(prop)
{ {
if(!value) { value = "NOTFOUND"; } if(!value) { value = "NOTFOUND"; }
sf->Properties.SetProperty(prop, value, cmProperty::SOURCE_FILE); sf->Properties.SetProperty(prop, value);
} }
} }
@ -801,8 +801,7 @@ void CCONV cmSourceFileSetName2(void *arg, const char* name, const char* dir,
// Implement the old SetName method code here. // Implement the old SetName method code here.
if(headerFileOnly) if(headerFileOnly)
{ {
sf->Properties.SetProperty("HEADER_FILE_ONLY", "1", sf->Properties.SetProperty("HEADER_FILE_ONLY", "1");
cmProperty::SOURCE_FILE);
} }
sf->SourceName = name; sf->SourceName = name;
std::string fname = sf->SourceName; std::string fname = sf->SourceName;

View File

@ -763,7 +763,7 @@ void cmCacheManager::CacheEntry::SetProperty(const std::string& prop,
} }
else else
{ {
this->Properties.SetProperty(prop, value, cmProperty::CACHE); this->Properties.SetProperty(prop, value);
} }
} }
@ -789,7 +789,7 @@ void cmCacheManager::CacheEntry::AppendProperty(const std::string& prop,
} }
else else
{ {
this->Properties.AppendProperty(prop, value, cmProperty::CACHE, asString); this->Properties.AppendProperty(prop, value, asString);
} }
} }

View File

@ -4089,7 +4089,7 @@ void cmMakefile::SetProperty(const std::string& prop, const char* value)
} }
} }
this->Properties.SetProperty(prop,value,cmProperty::DIRECTORY); this->Properties.SetProperty(prop, value);
} }
void cmMakefile::AppendProperty(const std::string& prop, void cmMakefile::AppendProperty(const std::string& prop,
@ -4129,7 +4129,7 @@ void cmMakefile::AppendProperty(const std::string& prop,
return; return;
} }
this->Properties.AppendProperty(prop,value,cmProperty::DIRECTORY,asString); this->Properties.AppendProperty(prop, value, asString);
} }
const char *cmMakefile::GetProperty(const std::string& prop) const const char *cmMakefile::GetProperty(const std::string& prop) const

View File

@ -29,29 +29,26 @@ cmProperty *cmPropertyMap::GetOrCreateProperty(const std::string& name)
return prop; return prop;
} }
void cmPropertyMap::SetProperty(const std::string& name, const char *value, void cmPropertyMap::SetProperty(const std::string& name, const char *value)
cmProperty::ScopeType scope)
{ {
if(!value) if(!value)
{ {
this->erase(name); this->erase(name);
return; return;
} }
(void)scope;
cmProperty *prop = this->GetOrCreateProperty(name); cmProperty *prop = this->GetOrCreateProperty(name);
prop->Set(value); prop->Set(value);
} }
void cmPropertyMap::AppendProperty(const std::string& name, const char* value, void cmPropertyMap::AppendProperty(const std::string& name, const char* value,
cmProperty::ScopeType scope, bool asString) bool asString)
{ {
// Skip if nothing to append. // Skip if nothing to append.
if(!value || !*value) if(!value || !*value)
{ {
return; return;
} }
(void)scope;
cmProperty *prop = this->GetOrCreateProperty(name); cmProperty *prop = this->GetOrCreateProperty(name);
prop->Append(value,asString); prop->Append(value,asString);

View File

@ -21,11 +21,10 @@ class cmPropertyMap : public std::map<std::string,cmProperty>
public: public:
cmProperty *GetOrCreateProperty(const std::string& name); cmProperty *GetOrCreateProperty(const std::string& name);
void SetProperty(const std::string& name, const char *value, void SetProperty(const std::string& name, const char *value);
cmProperty::ScopeType scope);
void AppendProperty(const std::string& name, const char* value, void AppendProperty(const std::string& name, const char* value,
cmProperty::ScopeType scope, bool asString=false); bool asString=false);
const char *GetPropertyValue(const std::string& name, const char *GetPropertyValue(const std::string& name,
cmProperty::ScopeType scope, cmProperty::ScopeType scope,

View File

@ -299,7 +299,7 @@ bool cmSourceFile::Matches(cmSourceFileLocation const& loc)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmSourceFile::SetProperty(const std::string& prop, const char* value) void cmSourceFile::SetProperty(const std::string& prop, const char* value)
{ {
this->Properties.SetProperty(prop, value, cmProperty::SOURCE_FILE); this->Properties.SetProperty(prop, value);
if (this->IsUiFile) if (this->IsUiFile)
{ {
@ -315,8 +315,7 @@ void cmSourceFile::SetProperty(const std::string& prop, const char* value)
void cmSourceFile::AppendProperty(const std::string& prop, const char* value, void cmSourceFile::AppendProperty(const std::string& prop, const char* value,
bool asString) bool asString)
{ {
this->Properties.AppendProperty(prop, value, cmProperty::SOURCE_FILE, this->Properties.AppendProperty(prop, value, asString);
asString);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View File

@ -438,14 +438,13 @@ void cmState::RemoveUserDefinedCommands()
void cmState::SetGlobalProperty(const std::string& prop, const char* value) void cmState::SetGlobalProperty(const std::string& prop, const char* value)
{ {
this->GlobalProperties.SetProperty(prop, value, cmProperty::GLOBAL); this->GlobalProperties.SetProperty(prop, value);
} }
void cmState::AppendGlobalProperty(const std::string& prop, void cmState::AppendGlobalProperty(const std::string& prop,
const char* value, bool asString) const char* value, bool asString)
{ {
this->GlobalProperties.AppendProperty(prop, value, this->GlobalProperties.AppendProperty(prop, value, asString);
cmProperty::GLOBAL, asString);
} }
const char *cmState::GetGlobalProperty(const std::string& prop) const char *cmState::GetGlobalProperty(const std::string& prop)

View File

@ -1772,7 +1772,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
} }
else else
{ {
this->Properties.SetProperty(prop, value, cmProperty::TARGET); this->Properties.SetProperty(prop, value);
this->MaybeInvalidatePropertyCache(prop); this->MaybeInvalidatePropertyCache(prop);
} }
} }
@ -1857,7 +1857,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
} }
else else
{ {
this->Properties.AppendProperty(prop, value, cmProperty::TARGET, asString); this->Properties.AppendProperty(prop, value, asString);
this->MaybeInvalidatePropertyCache(prop); this->MaybeInvalidatePropertyCache(prop);
} }
} }
@ -2938,8 +2938,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
// cannot take into account the per-configuration name of the // cannot take into account the per-configuration name of the
// target because the configuration type may not be known at // target because the configuration type may not be known at
// CMake time. // CMake time.
this->Properties.SetProperty(propLOCATION, this->GetLocationForBuild(), this->Properties.SetProperty(propLOCATION, this->GetLocationForBuild());
cmProperty::TARGET);
} }
// Support "LOCATION_<CONFIG>". // Support "LOCATION_<CONFIG>".
@ -2950,9 +2949,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
return 0; return 0;
} }
const char* configName = prop.c_str() + 9; const char* configName = prop.c_str() + 9;
this->Properties.SetProperty(prop, this->Properties.SetProperty(prop, this->GetLocation(configName));
this->GetLocation(configName),
cmProperty::TARGET);
} }
// Support "<CONFIG>_LOCATION". // Support "<CONFIG>_LOCATION".
else if(cmHasLiteralSuffix(prop, "_LOCATION")) else if(cmHasLiteralSuffix(prop, "_LOCATION"))
@ -2964,9 +2961,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
{ {
return 0; return 0;
} }
this->Properties.SetProperty(prop, this->Properties.SetProperty(prop, this->GetLocation(configName));
this->GetLocation(configName),
cmProperty::TARGET);
} }
} }
} }
@ -3168,8 +3163,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
} }
} }
} }
this->Properties.SetProperty("SOURCES", ss.str().c_str(), this->Properties.SetProperty("SOURCES", ss.str().c_str());
cmProperty::TARGET);
} }
} }

View File

@ -69,12 +69,12 @@ bool cmTest::GetPropertyAsBool(const std::string& prop) const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTest::SetProperty(const std::string& prop, const char* value) void cmTest::SetProperty(const std::string& prop, const char* value)
{ {
this->Properties.SetProperty(prop, value, cmProperty::TEST); this->Properties.SetProperty(prop, value);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTest::AppendProperty(const std::string& prop, void cmTest::AppendProperty(const std::string& prop,
const char* value, bool asString) const char* value, bool asString)
{ {
this->Properties.AppendProperty(prop, value, cmProperty::TEST, asString); this->Properties.AppendProperty(prop, value, asString);
} }