QMake CONFIG + = console in CMake

In QMake:

CONFIG += console 

How do I get the same effect in CMake?

(specifications: Qt 5.0.2, CMake 2.8.10)

+6
source share
1 answer

You do nothing: for CMake, this is the default. If you want to use a Windows application, you need to add WIN32 parameters to call add_executable :

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

This will install the WinMain search linker instead of main , as you would expect for a Windows GUI application by setting the internal CMake WIN32_EXECUTABLE .

+4
source

Source: https://habr.com/ru/post/948173/


All Articles