CMake output can be configured by suppressing the standard messages generated by CMake and outputting the user message to the script launcher. Add the following code to your external CMakeLists.txt
:
set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CMAKE_SOURCE_DIR}/custom_output.sh")
RULE_MESSAGES OFF
.
RULE_LAUNCH_COMPILE script custom_output.sh
, CMake:
#!/bin/sh
SOURCE_FILE="${@: -1:1}"
OBJECT_FILE="${@: -3:1}"
echo "CC `basename \"$SOURCE_FILE\"`"
exec "$@"
script.
, RULE_LAUNCH_LINK script.