cmTargetCompileDefinitionsCommand.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmTargetCompileDefinitionsCommand_h
  4. #define cmTargetCompileDefinitionsCommand_h
  5. #include <cmConfigure.h>
  6. #include <string>
  7. #include <vector>
  8. #include "cmTargetPropCommandBase.h"
  9. #include "cmTypeMacro.h"
  10. class cmCommand;
  11. class cmExecutionStatus;
  12. class cmTarget;
  13. class cmTargetCompileDefinitionsCommand : public cmTargetPropCommandBase
  14. {
  15. public:
  16. /**
  17. * This is a virtual constructor for the command.
  18. */
  19. cmCommand* Clone() CM_OVERRIDE
  20. {
  21. return new cmTargetCompileDefinitionsCommand;
  22. }
  23. /**
  24. * This is called when the command is first encountered in
  25. * the CMakeLists.txt file.
  26. */
  27. bool InitialPass(std::vector<std::string> const& args,
  28. cmExecutionStatus& status) CM_OVERRIDE;
  29. /**
  30. * The name of the command as specified in CMakeList.txt.
  31. */
  32. std::string GetName() const CM_OVERRIDE
  33. {
  34. return "target_compile_definitions";
  35. }
  36. cmTypeMacro(cmTargetCompileDefinitionsCommand, cmTargetPropCommandBase);
  37. private:
  38. void HandleImportedTarget(const std::string& tgt) CM_OVERRIDE;
  39. void HandleMissingTarget(const std::string& name) CM_OVERRIDE;
  40. bool HandleDirectContent(cmTarget* tgt,
  41. const std::vector<std::string>& content,
  42. bool prepend, bool system) CM_OVERRIDE;
  43. std::string Join(const std::vector<std::string>& content) CM_OVERRIDE;
  44. };
  45. #endif