summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-06-06 13:42:31 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-06-06 13:44:17 (GMT)
commitf573bd22e4049746b53789fc0502cff8423dbe56 (patch)
treec165e4e8a08f46e61388cadf1071e0a0c82833ea /Source/cmLocalGenerator.cxx
parentccbc2259137fe61a770bb0b5538a20bf5e00bc8f (diff)
downloadCMake-f573bd22e4049746b53789fc0502cff8423dbe56.zip
CMake-f573bd22e4049746b53789fc0502cff8423dbe56.tar.gz
CMake-f573bd22e4049746b53789fc0502cff8423dbe56.tar.bz2
cmLocalGenerator: Add Feature API from cmMakefile.
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 da95a4d..899da56 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2573,6 +2573,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)