cmCTestBuildCommand.h 1.6 KB

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