diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2002-12-20 22:15:45 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2002-12-20 22:15:45 (GMT) |
commit | 3859417d1a6b583b6c84806b109426a85cfface6 (patch) | |
tree | 48aa4a483fcdcb7b8f81b700bbb165ab49950636 /Source/cmTarget.cxx | |
parent | 80c6f0fdec23e53daebfcd8d331f1a44004b234e (diff) | |
download | CMake-3859417d1a6b583b6c84806b109426a85cfface6.zip CMake-3859417d1a6b583b6c84806b109426a85cfface6.tar.gz CMake-3859417d1a6b583b6c84806b109426a85cfface6.tar.bz2 |
ENH: add target properties
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 1e97557..602f826 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -544,3 +544,39 @@ void cmTarget::GatherDependencies( const cmMakefile& mf, DeleteDependency( dep_map, lib, lib); // cannot depend on itself } } + + +void cmTarget::SetProperty(const char* prop, const char* value) +{ + if (!prop) + { + return; + } + if (!value) + { + value = "NOTFOUND"; + } + m_Properties[prop] = value; +} + +const char *cmTarget::GetProperty(const char* prop) const +{ + std::map<cmStdString,cmStdString>::const_iterator i = + m_Properties.find(prop); + if (i != m_Properties.end()) + { + return i->second.c_str(); + } + return 0; +} + +bool cmTarget::GetPropertyAsBool(const char* prop) const +{ + std::map<cmStdString,cmStdString>::const_iterator i = + m_Properties.find(prop); + if (i != m_Properties.end()) + { + return cmSystemTools::IsOn(i->second.c_str()); + } + return false; +} |