cmCMakePolicyCommand.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 "cmCommand.h"
  6. /** \class cmCMakePolicyCommand
  7. * \brief Set how CMake should handle policies
  8. *
  9. * cmCMakePolicyCommand sets how CMake should deal with backwards
  10. * compatibility policies.
  11. */
  12. class cmCMakePolicyCommand : public cmCommand
  13. {
  14. public:
  15. /**
  16. * This is a virtual constructor for the command.
  17. */
  18. cmCommand* Clone() CM_OVERRIDE { return new cmCMakePolicyCommand; }
  19. /**
  20. * This is called when the command is first encountered in
  21. * the CMakeLists.txt file.
  22. */
  23. bool InitialPass(std::vector<std::string> const& args,
  24. cmExecutionStatus& status) CM_OVERRIDE;
  25. /**
  26. * This determines if the command is invoked when in script mode.
  27. */
  28. bool IsScriptable() const CM_OVERRIDE { return true; }
  29. /**
  30. * The name of the command as specified in CMakeList.txt.
  31. */
  32. std::string GetName() const CM_OVERRIDE { return "cmake_policy"; }
  33. cmTypeMacro(cmCMakePolicyCommand, cmCommand);
  34. private:
  35. bool HandleSetMode(std::vector<std::string> const& args);
  36. bool HandleGetMode(std::vector<std::string> const& args);
  37. bool HandleVersionMode(std::vector<std::string> const& args);
  38. };
  39. #endif