cmCTestBuildCommand.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 "cmCTestHandlerCommand.h"
  7. #include "cmCommand.h"
  8. #include <string>
  9. #include <utility>
  10. #include <vector>
  11. #include "cm_memory.hxx"
  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();
  25. ~cmCTestBuildCommand() override;
  26. /**
  27. * This is a virtual constructor for the command.
  28. */
  29. std::unique_ptr<cmCommand> Clone() override
  30. {
  31. auto ni = cm::make_unique<cmCTestBuildCommand>();
  32. ni->CTest = this->CTest;
  33. ni->CTestScriptHandler = this->CTestScriptHandler;
  34. return std::unique_ptr<cmCommand>(std::move(ni));
  35. }
  36. /**
  37. * The name of the command as specified in CMakeList.txt.
  38. */
  39. std::string GetName() const override { return "ctest_build"; }
  40. bool InitialPass(std::vector<std::string> const& args,
  41. cmExecutionStatus& status) override;
  42. cmGlobalGenerator* GlobalGenerator;
  43. protected:
  44. cmCTestBuildHandler* Handler;
  45. enum
  46. {
  47. ctb_BUILD = ct_LAST,
  48. ctb_NUMBER_ERRORS,
  49. ctb_NUMBER_WARNINGS,
  50. ctb_TARGET,
  51. ctb_CONFIGURATION,
  52. ctb_FLAGS,
  53. ctb_PROJECT_NAME,
  54. ctb_LAST
  55. };
  56. cmCTestGenericHandler* InitializeHandler() override;
  57. };
  58. #endif