cmTargetPropCommandBase.h 1.6 KB

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