Skip to content
Permalink
Browse files

Build/CMake: Use colors only when supported

  • Loading branch information...
Zaffy committed May 21, 2019
1 parent bd06e4a commit ff8cd6a82d4da70a663154dff735bb1dfc894c55
Showing with 5 additions and 2 deletions.
  1. +5 −2 cmake/showoptions.cmake
@@ -9,8 +9,11 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# Add Colors
if (NOT WIN32)
# Check if we can output colors - fill TERM_COLORS with number of colors supported
execute_process(COMMAND tput colors OUTPUT_VARIABLE TERM_COLORS ERROR_QUIET)

# Add Colors if possible
if (TERM_COLORS GREATER_EQUAL 256)
string(ASCII 27 Esc)
function(ShowOption opt val)
string(SUBSTRING ${val} 0 2 ye_no)

0 comments on commit ff8cd6a

Please sign in to comment.
You can’t perform that action at this time.