summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-10-02 17:52:01 (GMT)
committerBrad King <brad.king@kitware.com>2009-10-02 17:52:01 (GMT)
commit1e482435912f44e05b5e67f19b1bc14ff58a3169 (patch)
treec317a934a8bfba0b942f2e0041c8e2cd8de50040 /Source/cmTarget.cxx
parent57df2abca804dd8e98d000441fc0035eef9d4829 (diff)
downloadCMake-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/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 8510b59..9233a1d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2245,6 +2245,26 @@ void cmTarget::GetTargetVersion(bool soversion,
}
//----------------------------------------------------------------------------
+const char* cmTarget::GetFeature(const char* feature, const char* config)
+{
+ 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;
+ }
+ return this->Makefile->GetFeature(feature, config);
+}
+
+//----------------------------------------------------------------------------
const char *cmTarget::GetProperty(const char* prop)
{
return this->GetProperty(prop, cmProperty::TARGET);