diff options
author | Brad King <brad.king@kitware.com> | 2009-10-02 17:52:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-10-02 17:52:01 (GMT) |
commit | 1e482435912f44e05b5e67f19b1bc14ff58a3169 (patch) | |
tree | c317a934a8bfba0b942f2e0041c8e2cd8de50040 /Source/cmMakefile.cxx | |
parent | 57df2abca804dd8e98d000441fc0035eef9d4829 (diff) | |
download | CMake-1e482435912f44e05b5e67f19b1bc14ff58a3169.zip CMake-1e482435912f44e05b5e67f19b1bc14ff58a3169.tar.gz CMake-1e482435912f44e05b5e67f19b1bc14ff58a3169.tar.bz2 |
Introduce "build feature" lookup framework
This creates cmTarget::GetFeature and cmMakefile::GetFeature methods to
query "build feature" properties. These methods handle local-to-global
scope and per-configuration property lookup. Specific build features
will be defined later.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 7aa1202..afe5324 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3311,6 +3311,31 @@ bool cmMakefile::GetPropertyAsBool(const char* prop) return cmSystemTools::IsOn(this->GetProperty(prop)); } +//---------------------------------------------------------------------------- +const char* cmMakefile::GetFeature(const char* feature, const char* config) +{ + // TODO: Define accumulation policy for features (prepend, append, replace). + // Currently we always replace. + if(config && *config) + { + std::string featureConfig = feature; + featureConfig += "_"; + featureConfig += cmSystemTools::UpperCase(config); + if(const char* value = this->GetProperty(featureConfig.c_str())) + { + return value; + } + } + if(const char* value = this->GetProperty(feature)) + { + return value; + } + if(cmLocalGenerator* parent = this->LocalGenerator->GetParent()) + { + return parent->GetMakefile()->GetFeature(feature, config); + } + return 0; +} cmTarget* cmMakefile::FindTarget(const char* name) { |