cmTargetPropCommandBase.h 1.57 KB
Newer Older
1 2
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
3 4 5
#ifndef cmTargetPropCommandBase_h
#define cmTargetPropCommandBase_h

6
#include "cmConfigure.h" // IWYU pragma: keep
7 8 9 10

#include <string>
#include <vector>

11 12 13 14 15 16 17
#include "cmCommand.h"

class cmTarget;

class cmTargetPropCommandBase : public cmCommand
{
public:
18 19
  enum ArgumentFlags
  {
20
    NO_FLAGS = 0,
21 22
    PROCESS_BEFORE = 1,
    PROCESS_SYSTEM = 2
23 24 25
  };

  bool HandleArguments(std::vector<std::string> const& args,
26 27
                       const std::string& prop,
                       ArgumentFlags flags = NO_FLAGS);
28

29 30
protected:
  std::string Property;
31
  cmTarget* Target = nullptr;
32 33 34 35

  virtual void HandleInterfaceContent(cmTarget* tgt,
                                      const std::vector<std::string>& content,
                                      bool prepend, bool system);
36

37
private:
38
  virtual void HandleMissingTarget(const std::string& name) = 0;
39

40 41
  virtual bool HandleDirectContent(cmTarget* tgt,
                                   const std::vector<std::string>& content,
42 43
                                   bool prepend, bool system) = 0;

44
  virtual std::string Join(const std::vector<std::string>& content) = 0;
45 46

  bool ProcessContentArgs(std::vector<std::string> const& args,
47 48 49
                          unsigned int& argIndex, bool prepend, bool system);
  bool PopulateTargetProperies(const std::string& scope,
                               const std::vector<std::string>& content,
50
                               bool prepend, bool system);
51 52 53
};

#endif