[CMake] CMake stripping "/SUBSYSTEM" out of LINK_FLAGS

Jens Auer jensa at miltenyibiotec.de
Fri Nov 11 03:36:02 EST 2011


Hi,

> >   it reaches the linker. I can't simply add WIN32 to 
> add_executable() 
> > because I want debug builds to use the console sub-system 
> and release 
> > builds to use the windows subsystem. I have three questions:

I don't have a solution in cmake, but I worked around this using code from here: http://www.halcyon.com/~ast/dload/guicon.htm.
It shows how to open a console window and redirect the output. It also has the benefit that the debug build is closer to release builds and that the entry point definition is more in line with the windows documentation (SUBSYSTEM:WINDOWS -> WinMain, SUBSYSTEM:CONSOLE -> main).

Best regards,
  Jens


More information about the CMake mailing list