I could reproduce your problem and you won't get the status messages if CPack's source code is not changed. The behavior you're experiencing is how CPack is currently implemented.
If you look into your CMake generated package
makefile rule you will find something like:
# Special rule for the target package
package: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool..."
[your path here]/cpack.exe --config ./CPackConfig.cmake
.PHONY : package
So you're calling cpack.exe
when doing make package
. To reproduce your problem I just appended the following line to CPackConfig.cmake
:
message(STATUS "+++ Test +++")
As you have already tested, only if I remove the STATUS
keyword I see the message. So I've tested to directly call from the command line:
> cpack.exe --verbose --debug --config ./CPackConfig.cmake
But still didn't get the message. When debugging cpack.exe
I could see that STATUS
messages do finally call cmake::UpdateProgress()
and there is simply no ProgressCallback
set in CPack
.
I think a fix is very simple, but I'm not sure if you're willing to change CMake's source code or e.g. if you want to raise a ticket in CMake's bug tracker.
Edit: I've successfully tested the following code extensions for cpack.cxx
with STATUS
messages:
void cpackProgress(const char *msg, float prog, void* ptr)
{
(void)prog;
cmCPackLog* log = static_cast<cmCPackLog*>(ptr);
cmCPack_Log(log, cmCPackLog::LOG_OUTPUT, msg << std::endl);
}
and then
int main (int argc, char const* const* argv)
{
[...]
cmake cminst;
cminst.SetProgressCallback(cpackProgress, &log);
[...]
}