2016-09-27 22:01:08 +03: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 21:35:21 +03:00
|
|
|
#include "cmPropertyDefinitionMap.h"
|
2016-04-29 16:40:20 +03:00
|
|
|
|
2016-08-24 01:29:15 +03:00
|
|
|
#include <utility>
|
2006-12-01 21:35:21 +03:00
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
void cmPropertyDefinitionMap::DefineProperty(const std::string& name,
|
|
|
|
cmProperty::ScopeType scope,
|
|
|
|
const char* ShortDescription,
|
|
|
|
const char* FullDescription,
|
|
|
|
bool chain)
|
2006-12-01 21:35:21 +03:00
|
|
|
{
|
|
|
|
cmPropertyDefinitionMap::iterator it = this->find(name);
|
2016-05-16 17:34:04 +03:00
|
|
|
cmPropertyDefinition* prop;
|
|
|
|
if (it == this->end()) {
|
2006-12-01 21:35:21 +03:00
|
|
|
prop = &(*this)[name];
|
2016-05-16 17:34:04 +03:00
|
|
|
prop->DefineProperty(name, scope, ShortDescription, FullDescription,
|
2013-09-17 17:08:58 +04:00
|
|
|
chain);
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2006-12-01 21:35:21 +03:00
|
|
|
}
|
|
|
|
|
2015-06-06 10:46:38 +03:00
|
|
|
bool cmPropertyDefinitionMap::IsPropertyDefined(const std::string& name) const
|
2006-12-01 21:35:21 +03:00
|
|
|
{
|
2016-06-02 00:29:53 +03:00
|
|
|
return this->find(name) != this->end();
|
2006-12-01 21:35:21 +03:00
|
|
|
}
|
|
|
|
|
2015-06-06 10:46:38 +03:00
|
|
|
bool cmPropertyDefinitionMap::IsPropertyChained(const std::string& name) const
|
2006-12-01 21:35:21 +03:00
|
|
|
{
|
2015-06-06 10:46:38 +03:00
|
|
|
cmPropertyDefinitionMap::const_iterator it = this->find(name);
|
2016-05-16 17:34:04 +03:00
|
|
|
if (it == this->end()) {
|
2006-12-01 21:35:21 +03:00
|
|
|
return false;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2006-12-01 21:35:21 +03:00
|
|
|
|
|
|
|
return it->second.IsChained();
|
|
|
|
}
|