-
Notifications
You must be signed in to change notification settings - Fork 1
/
ColorDebugOptions.cmake
66 lines (43 loc) · 1.86 KB
/
ColorDebugOptions.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
55
56
57
58
59
60
61
62
63
64
65
66
# ColorDebug options
# no colors
set(cd_no_color_default OFF)
if(DEFINED ENV{NO_COLOR})
if(NOT DEFINED COLOR_DEBUG_NO_COLOR)
message(STATUS "NO_COLOR environment variable present, disabling color output.")
endif()
set(cd_no_color_default ON)
endif()
option(COLOR_DEBUG_NO_COLOR "Choose if you want to disable colors altogether" ${cd_no_color_default})
if(COLOR_DEBUG_NO_COLOR)
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_DEFINITIONS CD_NO_COLOR)
endif()
# debug
option(COLOR_DEBUG_HIDE_ERROR "Choose if you want to hide error level messages" OFF)
if(COLOR_DEBUG_HIDE_ERROR)
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_DEFINITIONS CD_HIDE_ERROR)
endif()
# warning
option(COLOR_DEBUG_HIDE_WARNING "Choose if you want to hide warning level messages" OFF)
if(COLOR_DEBUG_HIDE_WARNING)
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_DEFINITIONS CD_HIDE_WARNING)
endif()
# success
option(COLOR_DEBUG_HIDE_SUCCESS "Choose if you want to hide success level messages" OFF)
if(COLOR_DEBUG_HIDE_SUCCESS)
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_DEFINITIONS CD_HIDE_SUCCESS)
endif()
# info
option(COLOR_DEBUG_HIDE_INFO "Choose if you want to hide info level messages" OFF)
if(COLOR_DEBUG_HIDE_INFO)
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_DEFINITIONS CD_HIDE_INFO)
endif()
# debug
option(COLOR_DEBUG_HIDE_DEBUG "Choose if you want to hide debug level messages" OFF)
if(COLOR_DEBUG_HIDE_DEBUG)
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_DEFINITIONS CD_HIDE_DEBUG)
endif()
# full file path
option(COLOR_DEBUG_FULL_FILE "Choose if you want to compile with CD_FULL_FILE" OFF)
if(COLOR_DEBUG_FULL_FILE)
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_DEFINITIONS CD_FULL_FILE)
endif()