2016-09-27 19:01:08 +00:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2006-12-01 18:35:21 +00:00
|
|
|
#include "cmPropertyDefinitionMap.h"
|
2016-04-29 13:40:20 +00:00
|
|
|
|
2016-08-23 22:29:15 +00:00
|
|
|
#include <utility>
|
2006-12-01 18:35:21 +00:00
|
|
|
|
2016-05-16 14:34:04 +00:00
|
|
|
void cmPropertyDefinitionMap::DefineProperty(const std::string& name,
|
|
|
|
cmProperty::ScopeType scope,
|
|
|
|
const char* ShortDescription,
|
|
|
|
const char* FullDescription,
|
|
|
|
bool chain)
|
2006-12-01 18:35:21 +00:00
|
|
|
{
|
|
|
|
cmPropertyDefinitionMap::iterator it = this->find(name);
|
2016-05-16 14:34:04 +00:00
|
|
|
cmPropertyDefinition* prop;
|
|
|
|
if (it == this->end()) {
|
2006-12-01 18:35:21 +00:00
|
|
|
prop = &(*this)[name];
|
2016-05-16 14:34:04 +00:00
|
|
|
prop->DefineProperty(name, scope, ShortDescription, FullDescription,
|
2013-09-17 13:08:58 +00:00
|
|
|
chain);
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2006-12-01 18:35:21 +00:00
|
|
|
}
|
|
|
|
|
2015-06-06 07:46:38 +00:00
|
|
|
bool cmPropertyDefinitionMap::IsPropertyDefined(const std::string& name) const
|
2006-12-01 18:35:21 +00:00
|
|
|
{
|
2016-06-01 21:29:53 +00:00
|
|
|
return this->find(name) != this->end();
|
2006-12-01 18:35:21 +00:00
|
|
|
}
|
|
|
|
|
2015-06-06 07:46:38 +00:00
|
|
|
bool cmPropertyDefinitionMap::IsPropertyChained(const std::string& name) const
|
2006-12-01 18:35:21 +00:00
|
|
|
{
|
2015-06-06 07:46:38 +00:00
|
|
|
cmPropertyDefinitionMap::const_iterator it = this->find(name);
|
2016-05-16 14:34:04 +00:00
|
|
|
if (it == this->end()) {
|
2006-12-01 18:35:21 +00:00
|
|
|
return false;
|
2016-05-16 14:34:04 +00:00
|
|
|
}
|
2006-12-01 18:35:21 +00:00
|
|
|
|
|
|
|
return it->second.IsChained();
|
|
|
|
}
|