cmCTestBuildCommand.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmCTestBuildCommand_h
  11. #define cmCTestBuildCommand_h
  12. #include "cmCTestHandlerCommand.h"
  13. class cmGlobalGenerator;
  14. class cmCTestBuildHandler;
  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();
  24. ~cmCTestBuildCommand();
  25. /**
  26. * This is a virtual constructor for the command.
  27. */
  28. virtual cmCommand* Clone()
  29. {
  30. cmCTestBuildCommand* ni = new cmCTestBuildCommand;
  31. ni->CTest = this->CTest;
  32. ni->CTestScriptHandler = this->CTestScriptHandler;
  33. return ni;
  34. }
  35. /**
  36. * The name of the command as specified in CMakeList.txt.
  37. */
  38. virtual const char* GetName() const { return "ctest_build";}
  39. /**
  40. * Succinct documentation.
  41. */
  42. virtual const char* GetTerseDocumentation() const
  43. {
  44. return "Build the project.";
  45. }
  46. virtual bool InitialPass(std::vector<std::string> const& args,
  47. cmExecutionStatus &status);
  48. /**
  49. * More documentation.
  50. */
  51. virtual const char* GetFullDocumentation() const
  52. {
  53. return
  54. " ctest_build([BUILD build_dir] [TARGET target] [RETURN_VALUE res]\n"
  55. " [APPEND][NUMBER_ERRORS val] [NUMBER_WARNINGS val])\n"
  56. "Builds the given build directory and stores results in Build.xml. "
  57. "If no BUILD is given, the CTEST_BINARY_DIRECTORY variable is used.\n"
  58. "The TARGET variable can be used to specify a build target. If none "
  59. "is specified, the \"all\" target will be built.\n"
  60. "The RETURN_VALUE option specifies a variable in which to store the "
  61. "return value of the native build tool. "
  62. "The NUMBER_ERRORS and NUMBER_WARNINGS options specify variables in "
  63. "which to store the number of build errors and warnings detected."
  64. "\n"
  65. CTEST_COMMAND_APPEND_OPTION_DOCS;
  66. }
  67. cmTypeMacro(cmCTestBuildCommand, cmCTestHandlerCommand);
  68. cmGlobalGenerator* GlobalGenerator;
  69. protected:
  70. cmCTestBuildHandler* Handler;
  71. enum {
  72. ctb_BUILD = ct_LAST,
  73. ctb_NUMBER_ERRORS,
  74. ctb_NUMBER_WARNINGS,
  75. ctb_TARGET,
  76. ctb_CONFIGURATION,
  77. ctb_FLAGS,
  78. ctb_PROJECT_NAME,
  79. ctb_LAST
  80. };
  81. cmCTestGenericHandler* InitializeHandler();
  82. };
  83. #endif