cmUnexpectedCommand.h 862 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 cmUnexpectedCommand_h
  4. #define cmUnexpectedCommand_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <string>
  7. #include <utility>
  8. #include <vector>
  9. #include "cm_memory.hxx"
  10. #include "cmCommand.h"
  11. class cmExecutionStatus;
  12. class cmUnexpectedCommand : public cmCommand
  13. {
  14. public:
  15. cmUnexpectedCommand(std::string name, const char* error)
  16. : Name(std::move(name))
  17. , Error(error)
  18. {
  19. }
  20. std::unique_ptr<cmCommand> Clone() override
  21. {
  22. return cm::make_unique<cmUnexpectedCommand>(this->Name, this->Error);
  23. }
  24. bool InitialPass(std::vector<std::string> const& args,
  25. cmExecutionStatus& status) override;
  26. private:
  27. std::string Name;
  28. const char* Error;
  29. };
  30. #endif