cmCTestBuildCommand.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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() { return "ctest_build";}
  39. /**
  40. * Succinct documentation.
  41. */
  42. virtual const char* GetTerseDocumentation()
  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()
  52. {
  53. return
  54. " ctest_build([BUILD build_dir] [RETURN_VALUE res] [APPEND]\n"
  55. " [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. "
  58. "The RETURN_VALUE option specifies a variable in which to store the "
  59. "return value of the native build tool. "
  60. "The NUMBER_ERRORS and NUMBER_WARNINGS options specify variables in "
  61. "which to store the number of build errors and warnings detected."
  62. "\n"
  63. CTEST_COMMAND_APPEND_OPTION_DOCS;
  64. }
  65. cmTypeMacro(cmCTestBuildCommand, cmCTestHandlerCommand);
  66. cmGlobalGenerator* GlobalGenerator;
  67. protected:
  68. cmCTestBuildHandler* Handler;
  69. enum {
  70. ctb_BUILD = ct_LAST,
  71. ctb_NUMBER_ERRORS,
  72. ctb_NUMBER_WARNINGS,
  73. ctb_TARGET,
  74. ctb_CONFIGURATION,
  75. ctb_FLAGS,
  76. ctb_PROJECT_NAME,
  77. ctb_LAST
  78. };
  79. cmCTestGenericHandler* InitializeHandler();
  80. };
  81. #endif