cmTargetPropCommandBase.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. #include "cmCommand.h"
  9. class cmTarget;
  10. class cmTargetPropCommandBase : public cmCommand
  11. {
  12. public:
  13. enum ArgumentFlags
  14. {
  15. NO_FLAGS = 0x0,
  16. PROCESS_BEFORE = 0x1,
  17. PROCESS_SYSTEM = 0x2,
  18. PROCESS_REUSE_FROM = 0x3
  19. };
  20. bool HandleArguments(std::vector<std::string> const& args,
  21. const std::string& prop,
  22. ArgumentFlags flags = NO_FLAGS);
  23. protected:
  24. std::string Property;
  25. cmTarget* Target = nullptr;
  26. virtual void HandleInterfaceContent(cmTarget* tgt,
  27. const std::vector<std::string>& content,
  28. bool prepend, bool system);
  29. private:
  30. virtual void HandleMissingTarget(const std::string& name) = 0;
  31. virtual bool HandleDirectContent(cmTarget* tgt,
  32. const std::vector<std::string>& content,
  33. bool prepend, bool system) = 0;
  34. virtual std::string Join(const std::vector<std::string>& content) = 0;
  35. bool ProcessContentArgs(std::vector<std::string> const& args,
  36. unsigned int& argIndex, bool prepend, bool system);
  37. bool PopulateTargetProperies(const std::string& scope,
  38. const std::vector<std::string>& content,
  39. bool prepend, bool system);
  40. };
  41. #endif