Use of the WIN32 executable property

Nicolás Alvarez nicolas.alvarez at gmail.com
Thu Oct 3 02:52:08 UTC 2013


[Background for the blissfully Windows-ignorant devs:
On Windows, executable files have a flag saying whether they are GUI
or console applications. Running a GUI application from a console will
give you the prompt back immediately; I think there's no way to
capture stdout. Running a console application from a console will show
stdout/stderr as usual and only give you the prompt back when the
program finishes, and running it from elsewhere, such as by
double-clicking the .exe file, will open a console window in order to
show output.]

In CMake, executables are console-mode by default, unless 'WIN32' is
passed to add_executable. KDECMakeSettings.cmake in ECM sets a
variable to change the default to GUI-mode instead. It can be set back
to console mode for a specific target using set_target_properties.

It's fine to set GUI mode globally, because most KDE applications are
graphical. But I think *all* autotests should be marked as console
executables. Some manual tests should be too; for example the
kcolorcollectiontest test in kguiaddons doesn't display any UI, it
only printf()s stuff into stdout.

In fact, I wonder if we should make all tests console applications by
default (in ecm_mark_as_test?)...

-- 
Nicolás


More information about the Kde-buildsystem mailing list