diff --git a/CMakeLists.txt b/CMakeLists.txt index abfe2131ba..9e22abd72f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -385,10 +385,14 @@ macro(check_compiler file_to_test flag_to_set) # Some build applications use regexes on build output to highlight build # errors. Below, we modify a compiler error message to avoid that a negative # probe is considered an error in such build applications. - string(REPLACE ": error:" - ": compiler_error:" ERROR_MESSAGE_PROCESSED - ${ERROR_MESSAGE}) - message(STATUS " ${ERROR_MESSAGE_PROCESSED}") + if(FEATURE_PROBE_VERBOSE) + string(REPLACE ": error:" + ": compiler_error:" ERROR_MESSAGE_PROCESSED + ${ERROR_MESSAGE}) + message(STATUS " ${ERROR_MESSAGE_PROCESSED}") + else() + message(STATUS "Use -DFEATURE_PROBE_VERBOSE=ON to view feature probe error output.") + endif() endif() endmacro()