cmLocalGenerator: Add Feature API from cmMakefile.

This commit is contained in:
Stephen Kelly
2015-06-06 15:42:31 +02:00
parent ccbc225913
commit f573bd22e4
5 changed files with 31 additions and 31 deletions
+27
View File
@@ -2572,6 +2572,33 @@ void cmLocalGenerator::AppendFeatureOptions(
}
}
//----------------------------------------------------------------------------
const char* cmLocalGenerator::GetFeature(const std::string& feature,
const std::string& config)
{
// TODO: Define accumulation policy for features (prepend, append, replace).
// Currently we always replace.
if(!config.empty())
{
std::string featureConfig = feature;
featureConfig += "_";
featureConfig += cmSystemTools::UpperCase(config);
if(const char* value = this->Makefile->GetProperty(featureConfig))
{
return value;
}
}
if(const char* value = this->Makefile->GetProperty(feature))
{
return value;
}
if(cmLocalGenerator* parent = this->GetParent())
{
return parent->GetFeature(feature, config);
}
return 0;
}
//----------------------------------------------------------------------------
std::string
cmLocalGenerator::ConstructComment(cmCustomCommandGenerator const& ccg,