cmMessageCommand.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 cmMessageCommand_h
  11. #define cmMessageCommand_h
  12. #include "cmCommand.h"
  13. /** \class cmMessageCommand
  14. * \brief Displays a message to the user
  15. *
  16. */
  17. class cmMessageCommand : public cmCommand
  18. {
  19. public:
  20. /**
  21. * This is a virtual constructor for the command.
  22. */
  23. virtual cmCommand* Clone()
  24. {
  25. return new cmMessageCommand;
  26. }
  27. /**
  28. * This is called when the command is first encountered in
  29. * the CMakeLists.txt file.
  30. */
  31. virtual bool InitialPass(std::vector<std::string> const& args,
  32. cmExecutionStatus &status);
  33. /**
  34. * The name of the command as specified in CMakeList.txt.
  35. */
  36. virtual const char* GetName() { return "message";}
  37. /**
  38. * This determines if the command is invoked when in script mode.
  39. */
  40. virtual bool IsScriptable() { return true; }
  41. /**
  42. * Succinct documentation.
  43. */
  44. virtual const char* GetTerseDocumentation()
  45. {
  46. return "Display a message to the user.";
  47. }
  48. /**
  49. * More documentation.
  50. */
  51. virtual const char* GetFullDocumentation()
  52. {
  53. return
  54. " message([STATUS|WARNING|AUTHOR_WARNING|FATAL_ERROR|SEND_ERROR]\n"
  55. " \"message to display\" ...)\n"
  56. "The optional keyword determines the type of message:\n"
  57. " (none) = Important information\n"
  58. " STATUS = Incidental information\n"
  59. " WARNING = CMake Warning, continue processing\n"
  60. " AUTHOR_WARNING = CMake Warning (dev), continue processing\n"
  61. " SEND_ERROR = CMake Error, continue but skip generation\n"
  62. " FATAL_ERROR = CMake Error, stop all processing\n"
  63. "The CMake command-line tool displays STATUS messages on stdout "
  64. "and all other message types on stderr. "
  65. "The CMake GUI displays all messages in its log area. "
  66. "The interactive dialogs (ccmake and CMakeSetup) show STATUS messages "
  67. "one at a time on a status line and other messages in interactive "
  68. "pop-up boxes."
  69. "\n"
  70. "CMake Warning and Error message text displays using a simple "
  71. "markup language. "
  72. "Non-indented text is formatted in line-wrapped paragraphs delimited "
  73. "by newlines. "
  74. "Indented text is considered pre-formatted."
  75. ;
  76. }
  77. cmTypeMacro(cmMessageCommand, cmCommand);
  78. };
  79. #endif