[cmake-developers] Capturing messages to log files

Brad King brad.king at kitware.com
Mon Jul 20 09:36:48 EDT 2015


On 07/18/2015 03:45 PM, Clifford Yapp wrote:
> Am I correct that cmSystemTools::Message is the gateway through which
> all of the console output from CMake exits?  If so, perhaps the
> simplest thing to do is simply allow copying to a log file at that
> point?  It would be nice to have files containing only errors, only
> warnings, etc. but it's not immediately clear to me how to set
> something like that up...

Look at Source/QtDialog/QCMake.cxx for use of SetStdoutCallback,
SetStderrCallback, SetMessageCallback, and SetProgressCallback.
The cmake-gui uses those to capture everything for display in
the dialog.

-Brad



More information about the cmake-developers mailing list