diff options
author | Andrej Rode <andrej.rode@ettus.com> | 2017-04-06 11:53:33 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-04-07 14:54:03 -0700 |
commit | 543c8c40f1aab7e7c394af4e1195a722fa0a047e (patch) | |
tree | 10f073f955bad0295aa9756967d150f0917fd055 /host/cmake | |
parent | 282d57591b2e9befaff667dc9ab2febabcd61e93 (diff) | |
download | uhd-543c8c40f1aab7e7c394af4e1195a722fa0a047e.tar.gz uhd-543c8c40f1aab7e7c394af4e1195a722fa0a047e.tar.bz2 uhd-543c8c40f1aab7e7c394af4e1195a722fa0a047e.zip |
utils: add coloring depending on loglevel to console output
Diffstat (limited to 'host/cmake')
-rw-r--r-- | host/cmake/Modules/UHDLog.cmake | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/host/cmake/Modules/UHDLog.cmake b/host/cmake/Modules/UHDLog.cmake index 19b4c39ef..4bc1daf13 100644 --- a/host/cmake/Modules/UHDLog.cmake +++ b/host/cmake/Modules/UHDLog.cmake @@ -55,6 +55,16 @@ IF(UHD_LOG_FASTPATH_DISABLE) ADD_DEFINITIONS(-DUHD_LOG_FASTPATH_DISABLE) ENDIF() +IF(MSVC OR CYGWIN) + SET(UHD_LOG_CONSOLE_COLOR "OFF" CACHE BOOL "Enable color output on the terminal") +ELSE() + SET(UHD_LOG_CONSOLE_COLOR "ON" CACHE BOOL "Enable color output on the terminal") +ENDIF() + +IF(UHD_LOG_CONSOLE_COLOR) + ADD_DEFINITIONS(-DUHD_LOG_CONSOLE_COLOR) +ENDIF() + SET(UHD_LOG_FILE "" CACHE FILE "Set UHD log file to a file in a existing directory") IF(NOT UHD_LOG_FILE STREQUAL "") ADD_DEFINITIONS(-DUHD_LOG_FILE=${UHD_LOG_FILE}) |