diff options
-rw-r--r-- | modules/TDEMacros.cmake | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake index e608653..350e133 100644 --- a/modules/TDEMacros.cmake +++ b/modules/TDEMacros.cmake @@ -41,6 +41,19 @@ if( NOT TDE_CMAKE_ROOT ) CACHE FILEPATH "TDE CMake templates" ) endif() + + + option( FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." FALSE ) + if( ${FORCE_COLORED_OUTPUT} ) + if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" ) + if( NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9" ) + add_compile_options (-fdiagnostics-color=always) + endif() + elseif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" ) + add_compile_options (-fcolor-diagnostics) + endif() + endif() + endif() |