cmDependencyProvider.h 915 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #pragma once
  4. #include "cmConfigure.h" // IWYU pragma: keep
  5. #include <algorithm>
  6. #include <string>
  7. #include <utility>
  8. #include <vector>
  9. class cmDependencyProvider
  10. {
  11. public:
  12. enum class Method
  13. {
  14. FindPackage,
  15. FetchContentMakeAvailableSerial,
  16. };
  17. cmDependencyProvider(std::string command, std::vector<Method> methods)
  18. : Command(std::move(command))
  19. , Methods(std::move(methods))
  20. {
  21. }
  22. std::string const& GetCommand() const { return this->Command; }
  23. std::vector<Method> const& GetMethods() const { return this->Methods; }
  24. bool SupportsMethod(Method method) const
  25. {
  26. return std::find(this->Methods.begin(), this->Methods.end(), method) !=
  27. this->Methods.end();
  28. }
  29. private:
  30. std::string Command;
  31. std::vector<Method> Methods;
  32. };