X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fcmake%2Fmessage.cmake;h=c1e16bf89a939b2640bcf6643471815b2c759904;hb=aa01abb2b732abfb44559d25c9a11adfed57ac8b;hp=faee00091a2b759cc63775e7694fcb816a05bb0b;hpb=d16004d56c22635a0e21b177933dc39b65a3642a;p=vpp.git diff --git a/src/cmake/message.cmake b/src/cmake/message.cmake index faee00091a2..c1e16bf89a9 100644 --- a/src/cmake/message.cmake +++ b/src/cmake/message.cmake @@ -16,10 +16,12 @@ ############################################################################## function(message) list(GET ARGV 0 type) - string(ASCII 27 esc) - set(red "${esc}[1;31m") - set(yellow "${esc}[1;33m") - set(reset "${esc}[m") + if("$ENV{TERM}" STREQUAL "xterm-256color") + string(ASCII 27 esc) + set(red "${esc}[1;31m") + set(yellow "${esc}[1;33m") + set(reset "${esc}[m") + endif() if(type STREQUAL FATAL_ERROR OR type STREQUAL SEND_ERROR) list(REMOVE_AT ARGV 0) _message(${type} "${red}${ARGV}${reset}") @@ -34,3 +36,19 @@ function(message) endif() endfunction() +############################################################################## +# aligned config output +############################################################################## +function(pr desc val) + if("$ENV{TERM}" STREQUAL "xterm-256color") + string(ASCII 27 esc) + set(reset "${esc}[m") + set(cyan "${esc}[36m") + endif() + string(LENGTH ${desc} len) + while (len LESS 20) + set (desc "${desc} ") + string(LENGTH ${desc} len) + endwhile() + _message("${cyan}${desc}${reset}: ${val}") +endfunction()