cmTargetPropCommandBase.h 1.9 KB

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