summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-06-08 17:54:05 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-06-08 17:54:05 (GMT)
commitf5690cc57c0cd18ee8619332379f523c8fac46a1 (patch)
tree6b93d19bf93e344ee3a18b6d9941adbc3bd2331f /Source/cmLocalGenerator.cxx
parentd18852d5961584125ae113fae23f4b55a760e159 (diff)
parentf573bd22e4049746b53789fc0502cff8423dbe56 (diff)
downloadCMake-f5690cc57c0cd18ee8619332379f523c8fac46a1.zip
CMake-f5690cc57c0cd18ee8619332379f523c8fac46a1.tar.gz
CMake-f5690cc57c0cd18ee8619332379f523c8fac46a1.tar.bz2
Merge topic 'move-Feature-API'
f573bd22 cmLocalGenerator: Add Feature API from cmMakefile. ccbc2259 cmGeneratorTarget: Move Feature API from cmTarget.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index f8d1bee..5ed53d0 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2520,6 +2520,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,
const char* default_comment)