cmTargetPropCommandBase.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 = 0,
  16. PROCESS_BEFORE = 1,
  17. PROCESS_SYSTEM = 2
  18. };
  19. bool HandleArguments(std::vector<std::string> const& args,
  20. const std::string& prop,
  21. ArgumentFlags flags = NO_FLAGS);
  22. protected:
  23. std::string Property;
  24. cmTarget* Target;
  25. virtual void HandleInterfaceContent(cmTarget* tgt,
  26. const std::vector<std::string>& content,
  27. bool prepend, bool system);
  28. private:
  29. virtual void HandleMissingTarget(const std::string& name) = 0;
  30. virtual bool HandleDirectContent(cmTarget* tgt,
  31. const std::vector<std::string>& content,
  32. bool prepend, bool system) = 0;
  33. virtual std::string Join(const std::vector<std::string>& content) = 0;
  34. bool ProcessContentArgs(std::vector<std::string> const& args,
  35. unsigned int& argIndex, bool prepend, bool system);
  36. bool PopulateTargetProperies(const std::string& scope,
  37. const std::vector<std::string>& content,
  38. bool prepend, bool system);
  39. };
  40. #endif