cmExportSetMap.cxx 679 B

1234567891011121314151617181920212223242526272829
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmExportSetMap.h"
  4. #include "cmAlgorithms.h"
  5. #include "cmExportSet.h"
  6. #include <utility>
  7. cmExportSet* cmExportSetMap::operator[](const std::string& name)
  8. {
  9. std::map<std::string, cmExportSet*>::iterator it = this->find(name);
  10. if (it == this->end()) // Export set not found
  11. {
  12. it = this->insert(std::make_pair(name, new cmExportSet(name))).first;
  13. }
  14. return it->second;
  15. }
  16. void cmExportSetMap::clear()
  17. {
  18. cmDeleteAll(*this);
  19. this->derived::clear();
  20. }
  21. cmExportSetMap::~cmExportSetMap()
  22. {
  23. this->clear();
  24. }