cmProperty.cxx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 "cmProperty.h"
  11. #include "cmSystemTools.h"
  12. void cmProperty::Set(const char *name, const char *value)
  13. {
  14. this->Name = name;
  15. this->Value = value;
  16. this->ValueHasBeenSet = true;
  17. }
  18. void cmProperty::Append(const char *name, const char *value, bool asString)
  19. {
  20. this->Name = name;
  21. if(!this->Value.empty() && *value && !asString)
  22. {
  23. this->Value += ";";
  24. }
  25. this->Value += value;
  26. this->ValueHasBeenSet = true;
  27. }
  28. const char *cmProperty::GetValue() const
  29. {
  30. if (this->ValueHasBeenSet)
  31. {
  32. return this->Value.c_str();
  33. }
  34. return 0;
  35. }