message.rst 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. message
  2. -------
  3. Display a message to the user.
  4. .. code-block:: cmake
  5. message([<mode>] "message to display" ...)
  6. The optional ``<mode>`` keyword determines the type of message:
  7. ``FATAL_ERROR``
  8. CMake Error, stop processing and generation.
  9. ``SEND_ERROR``
  10. CMake Error, continue processing, but skip generation.
  11. ``WARNING``
  12. CMake Warning, continue processing.
  13. ``AUTHOR_WARNING``
  14. CMake Warning (dev), continue processing.
  15. ``DEPRECATION``
  16. CMake Deprecation Error or Warning if variable
  17. :variable:`CMAKE_ERROR_DEPRECATED` or :variable:`CMAKE_WARN_DEPRECATED`
  18. is enabled, respectively, else no message.
  19. (none) or ``NOTICE``
  20. Important message printed to stderr to attract user's attention.
  21. ``STATUS``
  22. The main interesting messages that project users might be interested in.
  23. Ideally these should be concise, no more than a single line, but still
  24. informative.
  25. ``VERBOSE``
  26. Detailed informational messages intended for project users. These messages
  27. should provide additional details that won't be of interest in most cases,
  28. but which may be useful to those building the project when they want deeper
  29. insight into what's happening.
  30. ``DEBUG``
  31. Detailed informational messages intended for developers working on the
  32. project itself as opposed to users who just want to build it. These messages
  33. will not typically be of interest to other users building the project and
  34. will often be closely related to internal implementation details.
  35. ``TRACE``
  36. Fine-grained messages with very low-level implementation details. Messages
  37. using this log level would normally only be temporary and would expect to be
  38. removed before releasing the project, packaging up the files, etc.
  39. The CMake command-line tool displays ``STATUS`` to ``TRACE`` messages on stdout
  40. with the message preceded by two hyphens and a space. All other message types
  41. are sent to stderr and are not prefixed with hyphens. The
  42. :manual:`CMake GUI <cmake-gui(1)>` displays all messages in its log area.
  43. The :manual:`curses interface <ccmake(1)>` shows ``STATUS`` to ``TRACE``
  44. messages one at a time on a status line and other messages in an
  45. interactive pop-up box. The ``--loglevel`` command-line option to each of
  46. these tools can be used to control which messages will be shown.
  47. CMake Warning and Error message text displays using a simple markup
  48. language. Non-indented text is formatted in line-wrapped paragraphs
  49. delimited by newlines. Indented text is considered pre-formatted.