cmCTestBuildCommand.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #pragma once
  4. #include "cmConfigure.h" // IWYU pragma: keep
  5. #include <string>
  6. #include <utility>
  7. #include <vector>
  8. #include <cm/memory>
  9. #include "cmCTestHandlerCommand.h"
  10. #include "cmCommand.h"
  11. class cmCTestBuildHandler;
  12. class cmCTestGenericHandler;
  13. class cmExecutionStatus;
  14. class cmGlobalGenerator;
  15. /** \class cmCTestBuild
  16. * \brief Run a ctest script
  17. *
  18. * cmCTestBuildCommand defineds the command to build the project.
  19. */
  20. class cmCTestBuildCommand : public cmCTestHandlerCommand
  21. {
  22. public:
  23. ~cmCTestBuildCommand() override;
  24. /**
  25. * This is a virtual constructor for the command.
  26. */
  27. std::unique_ptr<cmCommand> Clone() override
  28. {
  29. auto ni = cm::make_unique<cmCTestBuildCommand>();
  30. ni->CTest = this->CTest;
  31. ni->CTestScriptHandler = this->CTestScriptHandler;
  32. return std::unique_ptr<cmCommand>(std::move(ni));
  33. }
  34. /**
  35. * The name of the command as specified in CMakeList.txt.
  36. */
  37. std::string GetName() const override { return "ctest_build"; }
  38. bool InitialPass(std::vector<std::string> const& args,
  39. cmExecutionStatus& status) override;
  40. std::unique_ptr<cmGlobalGenerator> GlobalGenerator;
  41. protected:
  42. cmCTestBuildHandler* Handler;
  43. void BindArguments() override;
  44. cmCTestGenericHandler* InitializeHandler() override;
  45. std::string NumberErrors;
  46. std::string NumberWarnings;
  47. std::string Target;
  48. std::string Configuration;
  49. std::string Flags;
  50. std::string ProjectName;
  51. };