diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index edb644de7..c2d1a7d89 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2368,25 +2368,22 @@ void cmLocalGenerator::AppendFeatureOptions( const char* cmLocalGenerator::GetFeature(const std::string& feature, const std::string& config) { + std::string featureName = feature; // 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)) + featureName += "_"; + featureName += cmSystemTools::UpperCase(config); + } + cmState::Snapshot snp = this->StateSnapshot; + while(snp.IsValid()) + { + if(const char* value = snp.GetDirectory().GetProperty(featureName)) { return value; } - } - if(const char* value = this->Makefile->GetProperty(feature)) - { - return value; - } - if(cmLocalGenerator* parent = this->GetParent()) - { - return parent->GetFeature(feature, config); + snp = snp.GetBuildsystemDirectoryParent(); } return 0; }