cmCTestBuildCommand.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 "Build the project.";
  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] [APPEND]\n"
  58. " [NUMBER_ERRORS val] [NUMBER_WARNINGS val])\n"
  59. "Builds the given build directory and stores results in Build.xml. "
  60. "If no BUILD is given, the CTEST_BINARY_DIRECTORY variable is used. "
  61. "The RETURN_VALUE option specifies a variable in which to store the "
  62. "return value of the native build tool. "
  63. "The NUMBER_ERRORS and NUMBER_WARNINGS options specify variables in "
  64. "which to store the number of build errors and warnings detected."
  65. "\n"
  66. CTEST_COMMAND_APPEND_OPTION_DOCS;
  67. }
  68. cmTypeMacro(cmCTestBuildCommand, cmCTestHandlerCommand);
  69. cmGlobalGenerator* GlobalGenerator;
  70. protected:
  71. cmCTestBuildHandler* Handler;
  72. enum {
  73. ctb_BUILD = ct_LAST,
  74. ctb_NUMBER_ERRORS,
  75. ctb_NUMBER_WARNINGS,
  76. ctb_LAST
  77. };
  78. cmCTestGenericHandler* InitializeHandler();
  79. };
  80. #endif