MantisBT - CMake
View Issue Details
0012566CMakeCMakepublic2011-11-09 19:412016-06-10 14:31
Gili 
Kitware Robot 
normalmajoralways
closedmoved 
PCWindows7
CMake 2.8.6 
 
0012566: REGRESSION: CMake suppresses /SUBSYSTEM linker flag
Some users wish to use the console subsystem for debug builds and windows subsystem for release builds. http://www.cmake.org/Wiki/VSConfigSpecificSettings [^] provides a solution that used to work but seems to have gotten broken in recent releases.

http://public.kitware.com/Bug/view.php?id=11171 [^] contains a patch that fixes this bug (by reversing the order in which manual linker flags and WIN32_EXECUTABLE are processed). Please apply https://public.kitware.com/Bug/file/3459/Bug-0011171-sub-topic-SUBSYSTEM-WINDOWS-linker-flag.patch [^]
1. Paste http://www.cmake.org/Wiki/VSConfigSpecificSettings [^] into CMakeFiles.txt
2. Build project under Visual Studio 2010 debug and release builds
3. Notice how the /SUBSYSTEM linker flag is being ignored
Ideally we should be able to set SUBSYSTEM directly instead of specifying LINK_FLAGS that show up under "Additional Options". Please consider fixing this separately as an feature request. Again, though, users should be able to configure different SUBSYSTEMS for different configurations (debug/release/etc).
No tags attached.
related to 0011171closed Bill Hoffman Visual Studio 10 solution generation is incorrect 
Issue History
2011-11-09 19:41GiliNew Issue
2011-11-10 11:10David ColeRelationship addedrelated to 0011171
2011-11-17 16:07Brad KingAssigned To => David Cole
2011-11-17 16:07Brad KingStatusnew => assigned
2011-11-17 16:08Brad KingNote Added: 0027815
2012-06-18 04:12sd-dmNote Added: 0029713
2012-11-21 15:44David ColeNote Added: 0031672
2012-11-21 15:45David ColeNote Added: 0031675
2012-11-21 15:45David ColeAssigned ToDavid Cole =>
2012-11-21 15:45David ColeStatusassigned => new
2016-06-10 14:28Kitware RobotNote Added: 0041929
2016-06-10 14:28Kitware RobotStatusnew => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0027815)
Brad King   
2011-11-17 16:08   
The goal is to be able to have per-config values for WIN32_EXECUTABLE. We should just offer that:

  add_executable(foo WIN32 foo.c)
  set_property(TARGET foo PROPERTY WIN32_EXECUTABLE_DEBUG 0)
(0029713)
sd-dm   
2012-06-18 04:12   
Workaround: Add the following lines to your application source:

#ifdef _DEBUG
#pragma comment(linker, "/SUBSYSTEM:CONSOLE")
#endif

Microsoft states that this is not supported (http://msdn.microsoft.com/en-us/library/7f0aews7.aspx [^]) but it perfectly works for our projects.
(0031672)
David Cole   
2012-11-21 15:44   
Un-assigning bugs that are not on the active roadmap, which no developers are actively working on for the CMake 2.8.11 release.

If one gets put back on the roadmap, re-assign it appropriately at that time.
(0031675)
David Cole   
2012-11-21 15:45   
Re-setting status back to "new" for bugs that are "assigned" but not assigned to a specific developer. When/if these bugs go back on the roadmap for a specific version, assignment to an appropriate developer should take place then...
(0041929)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.