diff options
author | Alexander Golubev <fatzer2@gmail.com> | 2024-03-06 23:19:33 +0300 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2024-03-06 22:15:52 +0100 |
commit | 10b018766921803a73a6cabdf4784b4ac7f162c9 (patch) | |
tree | b9696a22ee1c1beeb9b4c4533a0f382621aff6b9 | |
parent | 8b6215c660c8b4def9c0e6849e78704ad215b7d7 (diff) | |
download | tde-cmake-10b018766921803a73a6cabdf4784b4ac7f162c9.tar.gz tde-cmake-10b018766921803a73a6cabdf4784b4ac7f162c9.zip |
Add support for multiline messages in tde_message_* macros
Also convert tde_message_author_warning() to a function to not pollute
caller's environment.
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
(cherry picked from commit bcb80b4ea3538ca1d795342d1714f5adec2fefdf)
-rw-r--r-- | modules/TDEMacros.cmake | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake index 0392f9e..de51342 100644 --- a/modules/TDEMacros.cmake +++ b/modules/TDEMacros.cmake @@ -88,14 +88,27 @@ include( TDEVersion ) ################################################# ##### +##### tde_concat_msg + +macro( tde_concat_msg _msg ) + unset( ${_msg} ) + foreach( _arg ${ARGN} ) + string( APPEND ${_msg} " ${_arg}\n" ) + endforeach() +endmacro( tde_concat_msg ) + + +################################################# +##### ##### tde_message_author_warning -macro( tde_message_author_warning ) - message( AUTHOR_WARNING +function( tde_message_author_warning ) + tde_concat_msg( _msg ${ARGV} ) + message( AUTHOR_WARNING "-------------------------------------------------\n" - " ${ARGV}\n" + "${_msg}" "-------------------------------------------------" ) -endmacro( tde_message_author_warning ) +endfunction( tde_message_author_warning ) ################################################# @@ -103,9 +116,11 @@ endmacro( tde_message_author_warning ) ##### tde_message_fatal macro( tde_message_fatal ) + tde_concat_msg( _msg ${ARGV} ) + message( FATAL_ERROR "#################################################\n" - " ${ARGV}\n" + "${_msg}" "#################################################" ) endmacro( tde_message_fatal ) |