Функции для подсветки вывода сообщений в терминале
This commit is contained in:
parent
ea38edfdc4
commit
9c22c16d9b
39
MyxCMake/modules/MyxCMakeColoredMessages.cmake
Normal file
39
MyxCMake/modules/MyxCMakeColoredMessages.cmake
Normal file
@ -0,0 +1,39 @@
|
||||
if(DEFINED ENV{TERM} AND UNIX)
|
||||
string(ASCII 27 Esc)
|
||||
set(MyxCMakeColorReset "${Esc}[m")
|
||||
set(MyxCMakeColorBold "${Esc}[1m")
|
||||
set(MyxCMakeColorRed "${Esc}[31m")
|
||||
set(MyxCMakeColorGreen "${Esc}[32m")
|
||||
set(MyxCMakeColorYellow "${Esc}[33m")
|
||||
set(MyxCMakeColorBlue "${Esc}[34m")
|
||||
set(MyxCMakeColorMagenta "${Esc}[35m")
|
||||
set(MyxCMakeColorCyan "${Esc}[36m")
|
||||
set(MyxCMakeColorWhite "${Esc}[37m")
|
||||
set(MyxCMakeColorBoldRed "${Esc}[1;31m")
|
||||
set(MyxCMakeColorBoldGreen "${Esc}[1;32m")
|
||||
set(MyxCMakeColorBoldYellow "${Esc}[1;33m")
|
||||
set(MyxCMakeColorBoldBlue "${Esc}[1;34m")
|
||||
set(MyxCMakeColorBoldMagenta "${Esc}[1;35m")
|
||||
set(MyxCMakeColorBoldCyan "${Esc}[1;36m")
|
||||
set(MyxCMakeColorBoldWhite "${Esc}[1;37m")
|
||||
endif()
|
||||
|
||||
function(myx_cmake_message_error)
|
||||
message(FATAL_ERROR ${MyxCMakeColorBoldRed}${ARGV}${MyxCMakeColorReset})
|
||||
endfunction()
|
||||
|
||||
function(myx_cmake_message_warning)
|
||||
message(WARNING ${MyxCMakeColorRed}${ARGV}${MyxCMakeColorReset})
|
||||
endfunction()
|
||||
|
||||
function(myx_cmake_message_status)
|
||||
message(STATUS ${MyxCMakeColorMagenta}${ARGV}${MyxCMakeColorReset})
|
||||
endfunction()
|
||||
|
||||
function(myx_cmake_message_notice)
|
||||
message(STATUS ${MyxCMakeColorBold}${ARGV}${MyxCMakeColorReset})
|
||||
endfunction()
|
||||
|
||||
function(myx_cmake_message)
|
||||
message(${MyxCMakeColorReset}${ARGV}${MyxCMakeColorReset})
|
||||
endfunction()
|
@ -1,6 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
include(MyxCMakeColoredMessages)
|
||||
include(MyxCMakeCheckPaths)
|
||||
|
||||
link_directories(${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
|
||||
|
Loading…
Reference in New Issue
Block a user