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

cowwoc cowwoc at bbs.darktech.org
Wed Nov 9 19:28:38 EST 2011

cowwoc wrote:
> Hi,
> I'm using CMAKE 2.8.6 with Visual Studio 2010 Express. According to
> http://www.cmake.org/Wiki/VSConfigSpecificSettings I should be able run:
>   set_target_properties(main PROPERTIES LINK_FLAGS "/SUBSYSTEM:WINDOWS")
> where "main" is my project, but I've discovered that CMake strips
> "/SUBSYSTEM:WINDOWS" silently and never passes it to the linker. By
> contrast, if I run:
> set_target_properties(main PROPERTIES LINK_FLAGS "/SUBSYSTEM:foo")
>   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:
> 1. Why CMake is stripping this flag?
> 2. Why is it not issuing a warning of some sort?
> 3. How do I override SUBSYSTEM as suggested by this Wiki entry?
> Thanks,
> Gili

Looks like a bug that's been open for over a year now:

Any chance of increasing the priority of this bug?


View this message in context: http://cmake.3232098.n2.nabble.com/CMake-stripping-SUBSYSTEM-out-of-LINK-FLAGS-tp6980078p6980126.html
Sent from the CMake mailing list archive at Nabble.com.

More information about the CMake mailing list