cmPropertyDefinitionMap.cxx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #include "cmPropertyDefinitionMap.h"
  11. #include "cmDocumentationSection.h"
  12. #include "cmSystemTools.h"
  13. void cmPropertyDefinitionMap::DefineProperty(const std::string& name,
  14. cmProperty::ScopeType scope,
  15. const char* ShortDescription,
  16. const char* FullDescription,
  17. bool chain)
  18. {
  19. cmPropertyDefinitionMap::iterator it = this->find(name);
  20. cmPropertyDefinition* prop;
  21. if (it == this->end()) {
  22. prop = &(*this)[name];
  23. prop->DefineProperty(name, scope, ShortDescription, FullDescription,
  24. chain);
  25. }
  26. }
  27. bool cmPropertyDefinitionMap::IsPropertyDefined(const std::string& name) const
  28. {
  29. return this->find(name) != this->end();
  30. }
  31. bool cmPropertyDefinitionMap::IsPropertyChained(const std::string& name) const
  32. {
  33. cmPropertyDefinitionMap::const_iterator it = this->find(name);
  34. if (it == this->end()) {
  35. return false;
  36. }
  37. return it->second.IsChained();
  38. }