cmCTestEmptyBinaryDirectoryCommand.cxx 756 B

123456789101112131415161718192021222324252627
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmCTestEmptyBinaryDirectoryCommand.h"
  4. #include "cmCTestScriptHandler.h"
  5. #include <sstream>
  6. class cmExecutionStatus;
  7. bool cmCTestEmptyBinaryDirectoryCommand::InitialPass(
  8. std::vector<std::string> const& args, cmExecutionStatus& /*unused*/)
  9. {
  10. if (args.size() != 1) {
  11. this->SetError("called with incorrect number of arguments");
  12. return false;
  13. }
  14. if (!cmCTestScriptHandler::EmptyBinaryDirectory(args[0].c_str())) {
  15. std::ostringstream ostr;
  16. ostr << "problem removing the binary directory: " << args[0];
  17. this->SetError(ostr.str());
  18. return false;
  19. }
  20. return true;
  21. }