cmCTestBuildCommand.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmCTestBuildCommand_h
  14. #define cmCTestBuildCommand_h
  15. #include "cmCTestHandlerCommand.h"
  16. class cmGlobalGenerator;
  17. class cmCTestBuildHandler;
  18. /** \class cmCTestBuild
  19. * \brief Run a ctest script
  20. *
  21. * cmCTestBuildCommand defineds the command to build the project.
  22. */
  23. class cmCTestBuildCommand : public cmCTestHandlerCommand
  24. {
  25. public:
  26. cmCTestBuildCommand();
  27. ~cmCTestBuildCommand();
  28. /**
  29. * This is a virtual constructor for the command.
  30. */
  31. virtual cmCommand* Clone()
  32. {
  33. cmCTestBuildCommand* ni = new cmCTestBuildCommand;
  34. ni->CTest = this->CTest;
  35. ni->CTestScriptHandler = this->CTestScriptHandler;
  36. return ni;
  37. }
  38. /**
  39. * The name of the command as specified in CMakeList.txt.
  40. */
  41. virtual const char* GetName() { return "ctest_build";}
  42. /**
  43. * Succinct documentation.
  44. */
  45. virtual const char* GetTerseDocumentation()
  46. {
  47. return "Builds the repository.";
  48. }
  49. virtual bool InitialPass(std::vector<std::string> const& args,
  50. cmExecutionStatus &status);
  51. /**
  52. * More documentation.
  53. */
  54. virtual const char* GetFullDocumentation()
  55. {
  56. return
  57. " ctest_build([BUILD build_dir] [RETURN_VALUE res] "
  58. " [NUMBER_ERRORS val] [NUMBER_WARNINGS val])\n"
  59. "Builds the given build directory and stores results in Build.xml.";
  60. }
  61. cmTypeMacro(cmCTestBuildCommand, cmCTestHandlerCommand);
  62. cmGlobalGenerator* GlobalGenerator;
  63. protected:
  64. cmCTestBuildHandler* Handler;
  65. enum {
  66. ctb_BUILD = ct_LAST,
  67. ctb_NUMBER_ERRORS,
  68. ctb_NUMBER_WARNINGS,
  69. ctb_LAST
  70. };
  71. cmCTestGenericHandler* InitializeHandler();
  72. };
  73. #endif