cmProperty.cxx 1.0 KB

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