message-context.cmake 676 B

123456789101112131415161718192021222324252627
  1. function(bar)
  2. list(APPEND CMAKE_MESSAGE_CONTEXT "bar")
  3. list(APPEND CMAKE_MESSAGE_INDENT "<-- indent -->")
  4. message(VERBOSE "bar VERBOSE message")
  5. endfunction()
  6. function(baz)
  7. list(APPEND CMAKE_MESSAGE_CONTEXT "baz")
  8. message(DEBUG "This is the multi-line\nbaz DEBUG message")
  9. endfunction()
  10. function(foo)
  11. list(APPEND CMAKE_MESSAGE_CONTEXT "foo")
  12. bar()
  13. message(TRACE "foo TRACE message")
  14. baz()
  15. endfunction()
  16. message(STATUS "Begin context output test")
  17. list(APPEND CMAKE_MESSAGE_CONTEXT "top")
  18. message(STATUS "Top: before")
  19. foo()
  20. message(STATUS "Top: after")
  21. list(POP_BACK CMAKE_MESSAGE_CONTEXT)
  22. message(STATUS "End of context output test")