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

cowwoc cowwoc at bbs.darktech.org
Wed Nov 9 19:08:13 EST 2011


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

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


More information about the CMake mailing list