summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-05-21 13:34:32 (GMT)
committerBrad King <brad.king@kitware.com>2014-05-21 13:38:22 (GMT)
commitc2eeb08b06d422c7b72aa9e6431e6e7584ce8c74 (patch)
tree82e20e3d0c60ee5573227aa54a992fc5db55394b /Source
parentf7654a07d5156c5f2899884949108dbe815563ce (diff)
downloadCMake-c2eeb08b06d422c7b72aa9e6431e6e7584ce8c74.zip
CMake-c2eeb08b06d422c7b72aa9e6431e6e7584ce8c74.tar.gz
CMake-c2eeb08b06d422c7b72aa9e6431e6e7584ce8c74.tar.bz2
cmTarget: Add GetFeatureAsBool method
Return the GetFeature method result converted to a boolean value.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx2
-rw-r--r--Source/cmNinjaTargetGenerator.cxx2
-rw-r--r--Source/cmTarget.cxx7
-rw-r--r--Source/cmTarget.h2
4 files changed, 11 insertions, 2 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 73d24a9..a08d731 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -2105,7 +2105,7 @@ const char* cmMakefileTargetGenerator::GetFeature(const std::string& feature)
//----------------------------------------------------------------------------
bool cmMakefileTargetGenerator::GetFeatureAsBool(const std::string& feature)
{
- return cmSystemTools::IsOn(this->GetFeature(feature));
+ return this->Target->GetFeatureAsBool(feature, this->ConfigName);
}
//----------------------------------------------------------------------------
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 54e398c..c3b4c75 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -105,7 +105,7 @@ const char* cmNinjaTargetGenerator::GetFeature(const std::string& feature)
// TODO: Picked up from cmMakefileTargetGenerator. Refactor it.
bool cmNinjaTargetGenerator::GetFeatureAsBool(const std::string& feature)
{
- return cmSystemTools::IsOn(this->GetFeature(feature));
+ return this->Target->GetFeatureAsBool(feature, this->GetConfigName());
}
// TODO: Picked up from cmMakefileTargetGenerator. Refactor it.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 86842a4..d8b7373 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -3181,6 +3181,13 @@ const char* cmTarget::GetFeature(const std::string& feature,
}
//----------------------------------------------------------------------------
+bool cmTarget::GetFeatureAsBool(const std::string& feature,
+ const std::string& config) const
+{
+ return cmSystemTools::IsOn(this->GetFeature(feature, config));
+}
+
+//----------------------------------------------------------------------------
bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const
{
if (this->IsImported())
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index bee6b34..93e1b5b 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -237,6 +237,8 @@ public:
const char* GetFeature(const std::string& feature,
const std::string& config) const;
+ bool GetFeatureAsBool(const std::string& feature,
+ const std::string& config) const;
bool IsImported() const {return this->IsImportedTarget;}