View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0014326 | CMake | (No Category) | public | 2013-07-31 08:02 | 2013-12-02 08:51 | ||||
Reporter | Soeren Textor | ||||||||
Assigned To | Brad King | ||||||||
Priority | high | Severity | minor | Reproducibility | always | ||||
Status | closed | Resolution | fixed | ||||||
Platform | Windows | OS | Windows | OS Version | 7 | ||||
Product Version | CMake 2.8.11.2 | ||||||||
Target Version | CMake 2.8.12 | Fixed in Version | CMake 2.8.12 | ||||||
Summary | 0014326: VS2012 generator ignores /SUBSYSTEM:WNDOWS | ||||||||
Description | We define for all Win and MFC projects the Subystem with "/SUBSYSTEM:WINDOWS". This works very well for VS2003/2005 and 2008 (2010 we did not try). But for VS2012 this flag is ignored by cmake. Only at add_executable( MY_TARGET WIN32 ${MY_files} ) we obtain the correct flag. Otherwise we find /CONSOLE:CONSOLE"5,01 inside the link options... | ||||||||
Steps To Reproduce | first we add the link option with: set_target_properties( MY_TARGET PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS") then we set set(CMAKE_MFC_FLAG 1) #1 for static the static MFC library and add_library( ${project_name} SHARED ${_files} ) | ||||||||
Additional Information | the result in the vcxproj is: <subsystem>console</subsystem> At VS2008 we have something like: AdditionalOptions=" /machine:X86 /debug /swaprun:net /LIBPATH:E:/DitecLibs/Lib nafxcwd.lib /SUBSYSTEM:WINDOWS" and that works fine. I think the parser somehow ignores the SUBSYSTEM command. Is that the point? | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
Relationships | |
Relationships |
Notes | |
(0033631) Brad King (manager) 2013-07-31 09:11 |
CMake appends a hard-coded /SUBSYSTEM:... flag after the LINK_FLAGS property values before parsing out the flags: http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmVisualStudio10TargetGenerator.cxx;hb=v2.8.11.2#l1429 [^] The hard-coded value is based on the WIN32_EXECUTABLE target property which is set by the WIN32 option to add_executable. This is the documented way to get a Windows GUI binary. |
(0033632) Soeren Textor (reporter) 2013-07-31 09:21 |
I see. But do you think this behavior makes sense if the user wants to select the subsystem for the case that the project is not a WIN32_EXECUTABLE? |
(0033633) Soeren Textor (reporter) 2013-07-31 09:27 |
Especially for shared library projects that can be console dlls or most of the time windows dlls (inside windows) there seems no proper way to set this flag since cmake VS 2010 generator :-8 |
(0033635) Brad King (manager) 2013-07-31 09:57 |
I think the order can be switched to give precedence to the user-specified flags. Actually the VS 7-9 generators should be refactored to generate the Subsystem attribute value based on flag parsing instead of hard-coding it as it does now. It is only luck that the IDE puts the user-specified flag after that generated from the attribute. |
(0033636) Brad King (manager) 2013-07-31 10:13 |
One possible workaround: set_property(TARGET mysharedlib PROPERTY WIN32_EXECUTABLE 1) |
(0033637) Soeren Textor (reporter) 2013-07-31 10:19 |
The latter works for me also I still think that there should be a better solution somewhen. |
(0033638) Brad King (manager) 2013-07-31 10:23 |
Fixed for VS >= 10: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b64e8f22 [^] The refactoring for older versions mentioned in 0014326:0033635 is not necessary but would be a nice-to-have future cleanup. |
(0034661) Robert Maynard (manager) 2013-12-02 08:51 |
Closing resolved issues that have not been updated in more than 4 months. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2013-07-31 08:02 | Soeren Textor | New Issue | |
2013-07-31 09:11 | Brad King | Note Added: 0033631 | |
2013-07-31 09:21 | Soeren Textor | Note Added: 0033632 | |
2013-07-31 09:27 | Soeren Textor | Note Added: 0033633 | |
2013-07-31 09:57 | Brad King | Note Added: 0033635 | |
2013-07-31 09:57 | Brad King | Status | new => backlog |
2013-07-31 10:13 | Brad King | Note Added: 0033636 | |
2013-07-31 10:19 | Soeren Textor | Note Added: 0033637 | |
2013-07-31 10:23 | Brad King | Note Added: 0033638 | |
2013-07-31 10:23 | Brad King | Assigned To | => Brad King |
2013-07-31 10:23 | Brad King | Status | backlog => resolved |
2013-07-31 10:23 | Brad King | Resolution | open => fixed |
2013-07-31 10:23 | Brad King | Fixed in Version | => CMake 2.8.12 |
2013-07-31 10:23 | Brad King | Target Version | => CMake 2.8.12 |
2013-12-02 08:51 | Robert Maynard | Note Added: 0034661 | |
2013-12-02 08:51 | Robert Maynard | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |