-
Notifications
You must be signed in to change notification settings - Fork 0
/
func.cmake
54 lines (52 loc) · 2.02 KB
/
func.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
if(WIN32)
string(ASCII 27 Esc)
set(ColourReset "${Esc}[m")
set(ColourBold "${Esc}[1m")
set(Red "${Esc}[31m")
set(Green "${Esc}[32m")
set(Yellow "${Esc}[33m")
set(Blue "${Esc}[34m")
set(Magenta "${Esc}[35m")
set(Cyan "${Esc}[36m")
set(White "${Esc}[37m")
set(BoldRed "${Esc}[1;31m")
set(BoldGreen "${Esc}[1;32m")
set(BoldYellow "${Esc}[1;33m")
set(BoldBlue "${Esc}[1;34m")
set(BoldMagenta "${Esc}[1;35m")
set(BoldCyan "${Esc}[1;36m")
set(BoldWhite "${Esc}[1;37m")
endif()
#message("This is normal")
#message("${Red}This is Red${ColourReset}")
#message("${Green}This is Green${ColourReset}")
#message("${Yellow}This is Yellow${ColourReset}")
#message("${Blue}This is Blue${ColourReset}")
#message("${Magenta}This is Magenta${ColourReset}")
#message("${Cyan}This is Cyan${ColourReset}")
#message("${White}This is White${ColourReset}")
#message("${BoldRed}This is BoldRed${ColourReset}")
#message("${BoldGreen}This is BoldGreen${ColourReset}")
#message("${BoldYellow}This is BoldYellow${ColourReset}")
#message("${BoldBlue}This is BoldBlue${ColourReset}")
#message("${BoldMagenta}This is BoldMagenta${ColourReset}")
#message("${BoldCyan}This is BoldCyan${ColourReset}")
#message("${BoldWhite}This is BoldWhite\n\n${ColourReset}")
function(message)
list(GET ARGV 0 MessageType)
if(MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR)
list(REMOVE_AT ARGV 0)
_message(${MessageType} "${BoldRed}${ARGV}${ColourReset}")
elseif(MessageType STREQUAL WARNING)
list(REMOVE_AT ARGV 0)
_message(${MessageType} "${BoldYellow}${ARGV}${ColourReset}")
elseif(MessageType STREQUAL AUTHOR_WARNING)
list(REMOVE_AT ARGV 0)
_message(${MessageType} "${BoldCyan}${ARGV}${ColourReset}")
elseif(MessageType STREQUAL STATUS)
list(REMOVE_AT ARGV 0)
_message(${MessageType} "${Green}${ARGV}${ColourReset}")
else()
_message("${ARGV}")
endif()
endfunction()