2009-09-28 19:43:28 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2006-12-01 21:35:21 +03:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2006-12-01 21:35:21 +03:00
|
|
|
|
2009-09-28 19:43:28 +04: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 21:35:21 +03:00
|
|
|
#include "cmPropertyDefinitionMap.h"
|
2016-04-29 16:40:20 +03:00
|
|
|
|
2007-10-22 20:49:09 +04:00
|
|
|
#include "cmDocumentationSection.h"
|
2016-04-29 17:53:13 +03:00
|
|
|
#include "cmSystemTools.h"
|
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
|
|
|
{
|
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 true;
|
|
|
|
}
|
|
|
|
|
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();
|
|
|
|
}
|