2009-09-28 15:43:28 +00:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2006-12-01 18:35:21 +00:00
|
|
|
|
2009-09-28 15:43:28 +00:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2006-12-01 18:35:21 +00:00
|
|
|
|
2009-09-28 15:43:28 +00:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the License for more information.
|
|
|
|
============================================================================*/
|
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();
|
|
|
|
}
|