The code in cpack that runs the preinstall build step is here. It currently has no option to show it on the terminal, but does capture and log the output to a file. If anyone is interested in adding a way to change that behavior, please open an issue to propose it.