cmContinueCommand.cxx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2014 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #include "cmContinueCommand.h"
  11. // cmContinueCommand
  12. bool cmContinueCommand::InitialPass(std::vector<std::string> const &args,
  13. cmExecutionStatus &status)
  14. {
  15. if(!this->Makefile->IsLoopBlock())
  16. {
  17. this->Makefile->IssueMessage(cmake::FATAL_ERROR,
  18. "A CONTINUE command was found outside of a "
  19. "proper FOREACH or WHILE loop scope.");
  20. cmSystemTools::SetFatalErrorOccured();
  21. return true;
  22. }
  23. status.SetContinueInvoked(true);
  24. if(!args.empty())
  25. {
  26. this->Makefile->IssueMessage(cmake::FATAL_ERROR,
  27. "The CONTINUE command does not accept any "
  28. "arguments.");
  29. cmSystemTools::SetFatalErrorOccured();
  30. return true;
  31. }
  32. return true;
  33. }