cmCMakePolicyCommand.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 cmCMakePolicyCommand_h
  4. #define cmCMakePolicyCommand_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <string>
  7. #include <vector>
  8. #include "cm_memory.hxx"
  9. #include "cmCommand.h"
  10. class cmExecutionStatus;
  11. /** \class cmCMakePolicyCommand
  12. * \brief Set how CMake should handle policies
  13. *
  14. * cmCMakePolicyCommand sets how CMake should deal with backwards
  15. * compatibility policies.
  16. */
  17. class cmCMakePolicyCommand : public cmCommand
  18. {
  19. public:
  20. /**
  21. * This is a virtual constructor for the command.
  22. */
  23. std::unique_ptr<cmCommand> Clone() override
  24. {
  25. return cm::make_unique<cmCMakePolicyCommand>();
  26. }
  27. /**
  28. * This is called when the command is first encountered in
  29. * the CMakeLists.txt file.
  30. */
  31. bool InitialPass(std::vector<std::string> const& args,
  32. cmExecutionStatus& status) override;
  33. private:
  34. bool HandleSetMode(std::vector<std::string> const& args);
  35. bool HandleGetMode(std::vector<std::string> const& args);
  36. bool HandleVersionMode(std::vector<std::string> const& args);
  37. bool HandleGetWarningMode(std::vector<std::string> const& args);
  38. };
  39. #endif