resolve cyclic dependency with zstd
[platform/upstream/cmake.git] / Source / cmDependencyProvider.h
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
5 #include "cmConfigure.h" // IWYU pragma: keep
6
7 #include <algorithm>
8 #include <string>
9 #include <utility>
10 #include <vector>
11
12 class cmDependencyProvider
13 {
14 public:
15   enum class Method
16   {
17     FindPackage,
18     FetchContentMakeAvailableSerial,
19   };
20
21   cmDependencyProvider(std::string command, std::vector<Method> methods)
22     : Command(std::move(command))
23     , Methods(std::move(methods))
24   {
25   }
26
27   std::string const& GetCommand() const { return this->Command; }
28   std::vector<Method> const& GetMethods() const { return this->Methods; }
29   bool SupportsMethod(Method method) const
30   {
31     return std::find(this->Methods.begin(), this->Methods.end(), method) !=
32       this->Methods.end();
33   }
34
35 private:
36   std::string Command;
37   std::vector<Method> Methods;
38 };