Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QMake's CONFIG+=console in CMake

Tags:

cmake

qt

In QMake:

CONFIG += console

How do I get the same effect in CMake?

(specs: Qt 5.0.2, CMake 2.8.10)

like image 316
user Avatar asked Jun 26 '13 23:06

user


1 Answers

You don't do anything: for CMake, it's the default. If you want a Windows application, you'll need to add the WIN32 options to the call to add_executable:

add_executable(<name> [WIN32] [MACOSX_BUNDLE]
               [EXCLUDE_FROM_ALL]
               source1 source2 ... sourceN)

This will set the linker to look for WinMain instead of main as you'd expect for a Windows GUI app, by setting the CMake internal WIN32_EXECUTABLE.

like image 134
rubenvb Avatar answered Nov 16 '22 03:11

rubenvb