cmTargetPropCommandBase.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmTargetPropCommandBase_h
  4. #define cmTargetPropCommandBase_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <string>
  7. #include <vector>
  8. class cmExecutionStatus;
  9. class cmMakefile;
  10. class cmTarget;
  11. class cmTargetPropCommandBase
  12. {
  13. public:
  14. cmTargetPropCommandBase(cmExecutionStatus& status);
  15. virtual ~cmTargetPropCommandBase() = default;
  16. void SetError(std::string const& e);
  17. enum ArgumentFlags
  18. {
  19. NO_FLAGS = 0x0,
  20. PROCESS_BEFORE = 0x1,
  21. PROCESS_SYSTEM = 0x2,
  22. PROCESS_REUSE_FROM = 0x3
  23. };
  24. bool HandleArguments(std::vector<std::string> const& args,
  25. const std::string& prop,
  26. ArgumentFlags flags = NO_FLAGS);
  27. protected:
  28. std::string Property;
  29. cmTarget* Target = nullptr;
  30. cmMakefile* Makefile;
  31. virtual void HandleInterfaceContent(cmTarget* tgt,
  32. const std::vector<std::string>& content,
  33. bool prepend, bool system);
  34. private:
  35. virtual void HandleMissingTarget(const std::string& name) = 0;
  36. virtual bool HandleDirectContent(cmTarget* tgt,
  37. const std::vector<std::string>& content,
  38. bool prepend, bool system) = 0;
  39. virtual std::string Join(const std::vector<std::string>& content) = 0;
  40. bool ProcessContentArgs(std::vector<std::string> const& args,
  41. unsigned int& argIndex, bool prepend, bool system);
  42. bool PopulateTargetProperies(const std::string& scope,
  43. const std::vector<std::string>& content,
  44. bool prepend, bool system);
  45. cmExecutionStatus& Status;
  46. };
  47. #endif