/src/CMake/Source/cmDependencyProvider.h
Line | Count | Source |
1 | | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
2 | | file LICENSE.rst 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 | 0 | : Command(std::move(command)) |
23 | 0 | , Methods(std::move(methods)) |
24 | 0 | { |
25 | 0 | } |
26 | | |
27 | 0 | std::string const& GetCommand() const { return this->Command; } |
28 | 0 | std::vector<Method> const& GetMethods() const { return this->Methods; } |
29 | | bool SupportsMethod(Method method) const |
30 | 0 | { |
31 | 0 | return std::find(this->Methods.begin(), this->Methods.end(), method) != |
32 | 0 | this->Methods.end(); |
33 | 0 | } |
34 | | |
35 | | private: |
36 | | std::string Command; |
37 | | std::vector<Method> Methods; |
38 | | }; |