cmTargetPropCommandBase.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. cmTypeMacro(cmTargetPropCommandBase, cmCommand);
  26. protected:
  27. std::string Property;
  28. cmTarget *Target;
  29. private:
  30. virtual void HandleImportedTarget(const std::string &tgt) = 0;
  31. virtual void HandleMissingTarget(const std::string &name) = 0;
  32. virtual void HandleDirectContent(cmTarget *tgt,
  33. const std::vector<std::string> &content,
  34. bool prepend) = 0;
  35. virtual std::string Join(const std::vector<std::string> &content) = 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::vector<std::string> &content,
  40. bool prepend);
  41. };
  42. #endif