57 lines
1.8 KiB
CMake
57 lines
1.8 KiB
CMake
#[=======================================================================[.rst:
|
||
|
||
Обёртки для функции `message()`, которые в терминале UNIX
|
||
подсвечивают сообщения в зависимости от важности.
|
||
|
||
#]=======================================================================]
|
||
|
||
include_guard(GLOBAL)
|
||
|
||
if(DEFINED ENV{COLORTERM} AND UNIX)
|
||
string(ASCII 27 Esc)
|
||
set(MyxColorReset "${Esc}[m")
|
||
set(MyxColorBold "${Esc}[1m")
|
||
set(MyxColorRed "${Esc}[31m")
|
||
set(MyxColorGreen "${Esc}[32m")
|
||
set(MyxColorYellow "${Esc}[33m")
|
||
set(MyxColorBlue "${Esc}[34m")
|
||
set(MyxColorMagenta "${Esc}[35m")
|
||
set(MyxColorCyan "${Esc}[36m")
|
||
set(MyxColorWhite "${Esc}[37m")
|
||
set(MyxColorBoldRed "${Esc}[1;31m")
|
||
set(MyxColorBoldGreen "${Esc}[1;32m")
|
||
set(MyxColorBoldYellow "${Esc}[1;33m")
|
||
set(MyxColorBoldBlue "${Esc}[1;34m")
|
||
set(MyxColorBoldMagenta "${Esc}[1;35m")
|
||
set(MyxColorBoldCyan "${Esc}[1;36m")
|
||
set(MyxColorBoldWhite "${Esc}[1;37m")
|
||
endif()
|
||
|
||
function(myx_message_fatal_error)
|
||
message(FATAL_ERROR ${MyxColorBoldRed}${ARGV}${MyxColorReset})
|
||
endfunction()
|
||
|
||
function(myx_message_send_error)
|
||
message(SEND_ERROR ${MyxColorBoldRed}${ARGV}${MyxColorReset})
|
||
endfunction()
|
||
|
||
function(myx_message_warning)
|
||
message(WARNING ${MyxColorRed}${ARGV}${MyxColorReset})
|
||
endfunction()
|
||
|
||
function(myx_message_deprecation)
|
||
message(DEPRECATION ${MyxColorBoldMagenta}${ARGV}${MyxColorReset})
|
||
endfunction()
|
||
|
||
function(myx_message_status)
|
||
message(STATUS ${MyxColorMagenta}${ARGV}${MyxColorReset})
|
||
endfunction()
|
||
|
||
function(myx_message_notice)
|
||
message(${MyxColorBold}${ARGV}${MyxColorReset})
|
||
endfunction()
|
||
|
||
function(myx_message)
|
||
message(${MyxColorReset}${ARGV}${MyxColorReset})
|
||
endfunction()
|