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 .
source share