Coverage Report

Created: 2026-02-09 06:05

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/CMake/Source/cmTargetPropCommandBase.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 <string>
8
#include <vector>
9
10
class cmExecutionStatus;
11
class cmMakefile;
12
class cmTarget;
13
14
class cmTargetPropCommandBase
15
{
16
public:
17
  cmTargetPropCommandBase(cmExecutionStatus& status);
18
0
  virtual ~cmTargetPropCommandBase() = default;
19
20
  void SetError(std::string const& e);
21
22
  enum ArgumentFlags
23
  {
24
    NO_FLAGS = 0x0,
25
    PROCESS_BEFORE = 0x1,
26
    PROCESS_AFTER = 0x2,
27
    PROCESS_SYSTEM = 0x4,
28
    PROCESS_REUSE_FROM = 0x8
29
  };
30
31
  bool HandleArguments(std::vector<std::string> const& args,
32
                       std::string const& prop, unsigned int flags = NO_FLAGS);
33
34
protected:
35
  std::string Property;
36
  cmTarget* Target = nullptr;
37
  cmMakefile* Makefile;
38
39
  virtual void HandleInterfaceContent(cmTarget* tgt,
40
                                      std::vector<std::string> const& content,
41
                                      bool prepend, bool system);
42
  virtual bool PopulateTargetProperties(
43
    std::string const& scope, std::vector<std::string> const& content,
44
    bool prepend, bool system);
45
46
private:
47
  virtual void HandleMissingTarget(std::string const& name) = 0;
48
49
  virtual bool HandleDirectContent(cmTarget* tgt,
50
                                   std::vector<std::string> const& content,
51
                                   bool prepend, bool system) = 0;
52
53
  virtual std::string Join(std::vector<std::string> const& content) = 0;
54
55
  bool ProcessContentArgs(std::vector<std::string> const& args,
56
                          unsigned int& argIndex, bool prepend, bool system);
57
58
  cmExecutionStatus& Status;
59
};