[cmake-developers] Making GUI applications by default

Brad King brad.king at kitware.com
Fri Feb 17 09:23:15 EST 2012


On 2/17/2012 5:44 AM, Stephen Kelly wrote:
> I meant 'default' in the sense of
> cmTarget::SetPropertyDefault, in the same way that set(CMAKE_AUTOMOC ON)
> sets the AUTOMOC property to true by default for all targets that follow.
[snip]
> default value of the property *if* set(CMAKE_CREATE_GUI_EXECUTABLES) is ON.

Instead of a special behavior for WIN32_EXECUTABLE and MACOSX_BUNDLE
property defaults, consider creating a new property that generalizes
the concept, such as "GUI_EXECUTABLE".  Teach the code and update the
documentation to specify that the property implies WIN32_EXECUTABLE
and MACOSX_BUNDLE on the respective platforms.

Then add SetPropertyDefault in the initialization of EXECUTABLE targets
so that

   set(CMAKE_GUI_EXECUTABLE 1)

will change the default for new executable targets in scope of the
variable.

-Brad



More information about the cmake-developers mailing list