cmake EXEC_PROGRAM merges stdout and stderr?

Brad King brad.king at kitware.com
Fri Feb 3 15:36:23 CET 2006


David Faure wrote:
> This warning line should obviously not be there. It's a warning by uic3, send to stderr.
> 
> The uic3 command issued by cmake is:
> cd /devel/kde/build/4/kdelibs4_cmake/kdeui && /devel/other/inst/bin/cmake -DKDE3_HEADER:BOOL=ON -DKDE_UIC_EXECUTABLE:FILEPATH=/devel/kde/src/4/qt-copy/bin/uic3 -DKDE_UIC_FILE:FILEPATH=/devel/kde/src/4/kdelibs/kdeui/kshortcutdialog_simple.ui3 -DKDE_UIC_H_FILE:FILEPATH=/devel/kde/build/4/kdelibs4_cmake/kdeui/kshortcutdialog_simple.h -DKDE_UIC_BASENAME:STRING=kshortcutdialog_simple -DKDE_UIC_PLUGIN_DIR:FILEPATH="." -P /devel/kde/src/4/kdelibs/cmake/modules/kde4uic.cmake
> Running cmake script file /devel/kde/src/4/kdelibs/cmake/modules/kde4uic.cmake
> 
> After adding debug output to cmake's cmExecProgramCommand.cxx (wow, nice, it's c++, no c as I thought I heard),
> I see:
> Executing command "/devel/kde/src/4/qt-copy/bin/uic3 -nounload -tr tr2i18n /devel/kde/src/4/kdelibs/kdeui/kshortcutdialog_simple.ui3"
> which is correct, but what does cmake do with its stdout and stderr?
> I see callbacks in cmSystemTools but I don't see one being set.... Any ideas?

The EXEC_PROGRAM command was originally added in the early days of CMake
in order to let people quickly convert autoconf projects by using
EXEC_PROGRAM to run the configure script for all the try-compiles.  In
that application both the stdout and stderr were desired.  Since then
its use has been expanded incrementally and it was never really updated. 
  It still uses a very old process-execution implementation that has
some severe limits.  Writing a new one that uses the robust process
exection implementation used by ctest has been on the todo list.

The complicated stdout/stderr callback stuff in CMake's implementation
is to allow ctest to use its own internal copy of CMakeLib to 
efficiently run "build-and-test" tests that run CMake as part of the 
test.  By using the internal CMake instead of starting a new process to 
generate the build system for the test one can run alot more tests quickly.

-Brad



More information about the Kde-buildsystem mailing list