|
1 | 1 | # ColorDebug options |
2 | 2 |
|
| 3 | +# no colors |
| 4 | + |
| 5 | +set(cd_no_color_default OFF) |
| 6 | + |
3 | 7 | if(DEFINED ENV{NO_COLOR}) |
4 | | - message(STATUS "NO_COLOR environment variable present, disabling color output.") |
| 8 | + if(NOT DEFINED COLOR_DEBUG_NO_COLOR) |
| 9 | + message(STATUS "NO_COLOR environment variable present, disabling color output.") |
| 10 | + endif() |
| 11 | + set(cd_no_color_default ON) |
5 | 12 | endif() |
6 | 13 |
|
7 | | -include(CMakeDependentOption) |
8 | | - |
9 | | -cmake_dependent_option(COLOR_DEBUG_NO_COLOR "Choose if you want to disable colors altogether" OFF |
10 | | - "NOT DEFINED ENV{NO_COLOR}" ON) |
| 14 | +option(COLOR_DEBUG_NO_COLOR "Choose if you want to disable colors altogether" ${cd_no_color_default}) |
11 | 15 |
|
12 | 16 | if(COLOR_DEBUG_NO_COLOR) |
13 | 17 | set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_DEFINITIONS CD_NO_COLOR) |
14 | 18 | endif() |
15 | 19 |
|
16 | | -cmake_dependent_option(COLOR_DEBUG_HIDE_ERROR "Choose if you want to hide error level messages" OFF |
17 | | - "NOT COLOR_DEBUG_NO_COLOR" OFF) |
| 20 | +# debug |
| 21 | + |
| 22 | +option(COLOR_DEBUG_HIDE_ERROR "Choose if you want to hide error level messages" OFF) |
18 | 23 |
|
19 | 24 | if(COLOR_DEBUG_HIDE_ERROR) |
20 | 25 | set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_DEFINITIONS CD_HIDE_ERROR) |
21 | 26 | endif() |
22 | 27 |
|
23 | | -cmake_dependent_option(COLOR_DEBUG_HIDE_WARNING "Choose if you want to hide warning level messages" OFF |
24 | | - "NOT COLOR_DEBUG_NO_COLOR" OFF) |
| 28 | +# warning |
| 29 | + |
| 30 | +option(COLOR_DEBUG_HIDE_WARNING "Choose if you want to hide warning level messages" OFF) |
25 | 31 |
|
26 | 32 | if(COLOR_DEBUG_HIDE_WARNING) |
27 | 33 | set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_DEFINITIONS CD_HIDE_WARNING) |
28 | 34 | endif() |
29 | 35 |
|
30 | | -cmake_dependent_option(COLOR_DEBUG_HIDE_SUCCESS "Choose if you want to hide success level messages" OFF |
31 | | - "NOT COLOR_DEBUG_NO_COLOR" OFF) |
| 36 | +# success |
| 37 | + |
| 38 | +option(COLOR_DEBUG_HIDE_SUCCESS "Choose if you want to hide success level messages" OFF) |
32 | 39 |
|
33 | 40 | if(COLOR_DEBUG_HIDE_SUCCESS) |
34 | 41 | set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_DEFINITIONS CD_HIDE_SUCCESS) |
35 | 42 | endif() |
36 | 43 |
|
37 | | -cmake_dependent_option(COLOR_DEBUG_HIDE_INFO "Choose if you want to hide info level messages" OFF |
38 | | - "NOT COLOR_DEBUG_NO_COLOR" OFF) |
| 44 | +# info |
| 45 | + |
| 46 | +option(COLOR_DEBUG_HIDE_INFO "Choose if you want to hide info level messages" OFF) |
39 | 47 |
|
40 | 48 | if(COLOR_DEBUG_HIDE_INFO) |
41 | 49 | set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_DEFINITIONS CD_HIDE_INFO) |
42 | 50 | endif() |
43 | 51 |
|
44 | | -cmake_dependent_option(COLOR_DEBUG_HIDE_DEBUG "Choose if you want to hide debug level messages" OFF |
45 | | - "NOT COLOR_DEBUG_NO_COLOR" OFF) |
| 52 | +# debug |
| 53 | + |
| 54 | +option(COLOR_DEBUG_HIDE_DEBUG "Choose if you want to hide debug level messages" OFF) |
46 | 55 |
|
47 | 56 | if(COLOR_DEBUG_HIDE_DEBUG) |
48 | 57 | set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY COMPILE_DEFINITIONS CD_HIDE_DEBUG) |
49 | 58 | endif() |
50 | 59 |
|
| 60 | +# full file path |
| 61 | + |
51 | 62 | option(COLOR_DEBUG_FULL_FILE "Choose if you want to compile with CD_FULL_FILE" OFF) |
52 | 63 |
|
53 | 64 | if(COLOR_DEBUG_FULL_FILE) |
|
0 commit comments