cmTargetPropCommandBase.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 void HandleDirectContent(cmTarget *tgt,
  31. const std::string &content,
  32. bool prepend) = 0;
  33. bool ProcessContentArgs(std::vector<std::string> const& args,
  34. unsigned int &argIndex, bool prepend);
  35. void PopulateTargetProperies(const std::string &scope,
  36. const std::string &content, bool prepend);
  37. private:
  38. cmTarget *Target;
  39. };
  40. #endif