cmTargetPropCommandBase.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 HandleImportedTarget(const std::string &tgt) = 0;
  27. virtual void HandleMissingTarget(const std::string &name) = 0;
  28. virtual bool HandleNonTargetArg(std::string &content,
  29. const std::string &sep,
  30. const std::string &entry,
  31. const std::string &tgt) = 0;
  32. virtual void HandleDirectContent(cmTarget *tgt,
  33. const std::string &content,
  34. bool prepend) = 0;
  35. bool ProcessContentArgs(std::vector<std::string> const& args,
  36. unsigned int &argIndex, bool prepend);
  37. void PopulateTargetProperies(const std::string &scope,
  38. const std::string &content, bool prepend);
  39. private:
  40. cmTarget *Target;
  41. std::string Property;
  42. };
  43. #endif