It’s weird to show console in GUI application for no matter what platform.
For the qmake project, the relevant setting is:
CONFIG += console CONFIG -= app_bundle
We have to remove the console and keep app_bundle for qmake variable CONFIG if we want to hide console when running the program.
For CMake project, it will create a console application by default.
If we want windows application, we have to add WIN32 or MACOSX_BUNDLE for add_executable.
add_executable(<name> [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] source1 [source2 ...])