cmTargetPropCommandBase.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2013 Stephen Kelly <[email protected]>
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmTargetPropCommandBase_h
  11. #define cmTargetPropCommandBase_h
  12. #include "cmCommand.h"
  13. #include "cmDocumentGeneratorExpressions.h"
  14. class cmTarget;
  15. //----------------------------------------------------------------------------
  16. class cmTargetPropCommandBase : public cmCommand
  17. {
  18. public:
  19. enum ArgumentFlags {
  20. NO_FLAGS = 0,
  21. PROCESS_BEFORE = 1
  22. };
  23. bool HandleArguments(std::vector<std::string> const& args,
  24. const char *prop, ArgumentFlags flags = NO_FLAGS);
  25. private:
  26. virtual void HandleImportedTargetInvalidScope(const std::string &tgt,
  27. const std::string &scope) = 0;
  28. virtual void HandleMissingTarget(const std::string &name) = 0;
  29. virtual bool HandleNonTargetArg(std::string &content,
  30. const std::string &sep,
  31. const std::string &entry,
  32. const std::string &tgt) = 0;
  33. virtual void HandleDirectContent(cmTarget *tgt,
  34. const std::string &content,
  35. bool prepend) = 0;
  36. bool ProcessContentArgs(std::vector<std::string> const& args,
  37. unsigned int &argIndex, bool prepend);
  38. void PopulateTargetProperies(const std::string &scope,
  39. const std::string &content, bool prepend);
  40. private:
  41. cmTarget *Target;
  42. std::string Property;
  43. };
  44. #endif