cmPropertyDefinitionMap.cxx 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 "cmSystemTools.h"
  12. #include "cmDocumentationSection.h"
  13. void cmPropertyDefinitionMap
  14. ::DefineProperty(const cmStdString& name, 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. {
  23. prop = &(*this)[name];
  24. prop->DefineProperty(name,scope,ShortDescription, FullDescription,
  25. chain);
  26. }
  27. }
  28. bool cmPropertyDefinitionMap::IsPropertyDefined(const cmStdString& name)
  29. {
  30. cmPropertyDefinitionMap::iterator it = this->find(name);
  31. if (it == this->end())
  32. {
  33. return false;
  34. }
  35. return true;
  36. }
  37. bool cmPropertyDefinitionMap::IsPropertyChained(const cmStdString& name)
  38. {
  39. cmPropertyDefinitionMap::iterator it = this->find(name);
  40. if (it == this->end())
  41. {
  42. return false;
  43. }
  44. return it->second.IsChained();
  45. }