-
Notifications
You must be signed in to change notification settings - Fork 86
/
Modules.cmake
42 lines (40 loc) · 1.28 KB
/
Modules.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
# Coloring functions
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")
# Helping functions
function(log)
if(ARGC GREATER 1)
list(GET ARGV 0 MessageType)
list(REMOVE_AT ARGV 0)
if(MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR)
message(${MessageType} "${BoldRed}${ARGV}${ColourReset}")
elseif(MessageType STREQUAL WARNING)
message("### ${BoldYellow}${ARGV}${ColourReset} ###")
elseif(MessageType STREQUAL AUTHOR_WARNING)
message(${MessageType} "${BoldCyan}${ARGV}${ColourReset}")
elseif(MessageType STREQUAL STATUS)
message(${MessageType} "${Green}${ARGV}${ColourReset}")
elseif(MessageType STREQUAL INFO)
message("-- ${Magenta}${ARGV}${ColourReset}")
else()
message("${ARGV}")
endif()
else()
message("${ARGV}")
endif()
endfunction()