MantisBT - CMake
View Issue Details
0011571CMakeModulespublic2010-12-04 07:122010-12-06 14:43
Cheese Russian 
Brad King 
normalminoralways
closedno change required 
CMake-2-8 
 
0011571: Does not use EXE subsystem when building GUI application with GCC for Windows
When building with GCC for Windows, in makefiles generated by CMake, there is no instruction to set a subsystem. The default subsystem is console, when building a console application, it does not matter. But when I make a GUI program, it becomes console, too, and shows a console window in background when running.

For example, if user configured to use Qt with QtGui module (FindQt*.cmake), the module should add the following option to gcc command line (CMAKE_EXE_LINKER_FLAGS): -Wl,-subsystem,windows.
FindQt(REQUIRED)

Use GCC to build an application for Win32.
Workaround:

IF( WIN32 )
  SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-subsystem,windows" )
ENDIF()
No tags attached.
Issue History
2010-12-04 07:12Cheese RussianNew Issue
2010-12-04 10:50Rolf Eike BeerNote Added: 0023717
2010-12-06 01:33Cheese RussianNote Added: 0023724
2010-12-06 14:43Brad KingStatusnew => closed
2010-12-06 14:43Brad KingAssigned To => Brad King
2010-12-06 14:43Brad KingResolutionopen => no change required

Notes
(0023717)
Rolf Eike Beer   
2010-12-04 10:50   
Did you add the WIN32 flag to your ADD_EXECUTABLE?
(0023724)
Cheese Russian   
2010-12-06 01:33   
Oh, it's my fail. I'm sorry.

Please close the issue.