myx/lib/ColoredMessages.cmake
2022-09-29 02:46:29 +03:00

44 lines
1.3 KiB
CMake

# Обёртки для функций вывода сообщений
include_guard(GLOBAL)
if(DEFINED ENV{TERM} 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_error)
message(FATAL_ERROR ${MyxColorBoldRed}${ARGV}${MyxColorReset})
endfunction()
function(myx_message_warning)
message(WARNING ${MyxColorRed}${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()