MantisBT - CMake
View Issue Details
0011213CMakeCMakepublic2010-09-07 11:362012-04-02 10:10
Randy Schott 
David Cole 
normalminoralways
closedfixed 
CMake-2-8 
CMake 2.8.7CMake 2.8.7 
0011213: VC2010 Generator handles CMAKE_MFC_FLAG incorrectly
I noticed this issue when moving some of our projects to VS2010/Cmake 2.8.2. In previous versions (and the VC 2008 generator), the CMAKE_MFC_FLAG specified how MFC was used. This is mapped as follows:
0 - not using MFC
1 - using MFC statically
2 - using MFC dynamically

I've noticed that the VC2010 generator simply checks for the existence of the CMAKE_MFC_FLAG variable, and writes out "true" or "false", ignoring the actual value of the flag (I've verified this by looking at the source). While this allows me to disable use of MFC by not defining the flag, it does not allow me to specify how mfc should be used.
  I believe the correct values in VC2010 are "false", "static", and "dynamic". The CMAKE_MFC_FLAG values should map to these strings. In fact, it might even make sense to have the CMAKE_MFC_FLAG use the values "false", "static", and "dynamic" itself, instead of the unclear numbering system found in previous versions of VC projects.
No tags attached.
related to 0011224closed David Cole Visual-Studo-2010 cannot interpret set (CMAKE_MFC_FLAG 2) => unable to compile project 
related to 0011638closed Kitware Robot ATL support 
diff vc10_mfc_flag.diff (1,329) 2010-09-07 16:07
https://public.kitware.com/Bug/file/3359/vc10_mfc_flag.diff
Issue History
2010-09-07 11:36Randy SchottNew Issue
2010-09-07 12:46Bill HoffmanNote Added: 0022109
2010-09-07 16:07Randy SchottFile Added: vc10_mfc_flag.diff
2010-09-07 16:18Randy SchottNote Added: 0022115
2010-12-22 09:40David ColeRelationship addedrelated to 0011224
2010-12-22 09:42David ColeRelationship addedrelated to 0011638
2010-12-22 09:46David ColeNote Added: 0024322
2010-12-22 09:47David ColeAssigned To => David Cole
2010-12-22 09:47David ColeStatusnew => assigned
2011-10-21 12:21David ColeTarget Version => CMake 2.8.7
2011-11-04 13:44David ColeNote Added: 0027723
2011-11-04 13:44David ColeStatusassigned => resolved
2011-11-04 13:44David ColeFixed in Version => CMake 2.8.7
2011-11-04 13:44David ColeResolutionopen => fixed
2011-11-04 13:45David ColeNote Added: 0027724
2012-04-02 10:10David ColeNote Added: 0029038
2012-04-02 10:10David ColeStatusresolved => closed

Notes
(0022109)
Bill Hoffman   
2010-09-07 12:46   
Can you create a patch?
(0022115)
Randy Schott   
2010-09-07 16:18   
I submitted a patch. Bear with me, it's the first time I've ever submitted one (and the first time I've ever used git). The attached patch should restore the usage of 0/1/2 and also accept "false", "static", and "dynamic".
(0024322)
David Cole   
2010-12-22 09:46   
Here's another case where a lack of a test is a contributing factor to the bug going unobserved by CMake developers.

If there were a test that built an MFC project, then the test would fail on Visual Studio 2010 dashboard submissions.
(0027723)
David Cole   
2011-11-04 13:44   
Fix pushed to 'next':

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=011694c269a1193ec8f7fe8dce8d4a86bcafa8e4 [^]
(0027724)
David Cole   
2011-11-04 13:45   
Note also, the MFC test was added and patched up to work on all the dashboard machines in all the commits leading up to this fix commit...
(0029038)
David Cole   
2012-04-02 10:10   
Closing resolved issues that have not been updated in more than 4 months.