cmBreakCommand.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 cmBreakCommand_h
  4. #define cmBreakCommand_h
  5. #include "cmCommand.h"
  6. /** \class cmBreakCommand
  7. * \brief Break from an enclosing foreach or while loop
  8. *
  9. * cmBreakCommand returns from an enclosing foreach or while loop
  10. */
  11. class cmBreakCommand : public cmCommand
  12. {
  13. public:
  14. /**
  15. * This is a virtual constructor for the command.
  16. */
  17. cmCommand* Clone() CM_OVERRIDE { return new cmBreakCommand; }
  18. /**
  19. * This is called when the command is first encountered in
  20. * the CMakeLists.txt file.
  21. */
  22. bool InitialPass(std::vector<std::string> const& args,
  23. cmExecutionStatus& status) CM_OVERRIDE;
  24. /**
  25. * This determines if the command is invoked when in script mode.
  26. */
  27. bool IsScriptable() const CM_OVERRIDE { return true; }
  28. /**
  29. * The name of the command as specified in CMakeList.txt.
  30. */
  31. std::string GetName() const CM_OVERRIDE { return "break"; }
  32. };
  33. #endif