Re: [CMake] CMake stripping /SUBSYSTEM out of LINK_FLAGS

2011-11-11 Thread Jens Auer
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
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] CMake stripping /SUBSYSTEM out of LINK_FLAGS

2011-11-09 Thread cowwoc
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.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CMake stripping /SUBSYSTEM out of LINK_FLAGS

2011-11-09 Thread cowwoc

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:
http://public.kitware.com/Bug/view.php?id=11171

Any chance of increasing the priority of this bug?

Gili

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

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake