MantisBT - CMake
View Issue Details
0011224CMakeCMakepublic2010-09-13 08:412012-04-02 10:10
ThomasZymara 
David Cole 
normalminoralways
closedfixed 
 
CMake 2.8.7CMake 2.8.7 
0011224: Visual-Studo-2010 cannot interpret set (CMAKE_MFC_FLAG 2) => unable to compile project
Is "set (CMAKE_MFC_FLAG 2)" set
Visual-Studio-2010 is unable to compile the project - error is:
             #error : Building MFC application with /MD[d] (CRT dll version)
                       requires MFC shared dll version. Please #define _AFXDLL
                        or do not use /MD[d] C:\Programme\Microsoft Visual
                        Studio 10.0\VC\atlmfc\include\afx.h

Reason:
In the project-properties the VS2010 switch "Using MFC" is set to "true", which cannot be interpreted by VS2010 - you have to switch this one to "...using mfc in a dll..."

This is a little bit mysteries, because after switch in VS2010 this switch to the right one, the project-file (....vcxproj) is binary equal - but it is now successful to compile the project
No tags attached.
related to 0011213closed David Cole VC2010 Generator handles CMAKE_MFC_FLAG incorrectly 
related to 0011638closed Kitware Robot ATL support 
patch 0001-BUG-0011224-fixed-MFC-build-in-VS2010.patch (1,387) 2010-10-09 13:34
https://public.kitware.com/Bug/file/3443/0001-BUG-0011224-fixed-MFC-build-in-VS2010.patch
patch 0001-BUG-0011224-fixed-MFC-build-in-VS2010_b.patch (1,397) 2010-10-18 14:38
https://public.kitware.com/Bug/file/3458/0001-BUG-0011224-fixed-MFC-build-in-VS2010_b.patch
Issue History
2010-09-13 08:41ThomasZymaraNew Issue
2010-10-09 13:34McBenFile Added: 0001-BUG-0011224-fixed-MFC-build-in-VS2010.patch
2010-10-09 13:38McBenNote Added: 0022463
2010-10-18 14:38McBenFile Added: 0001-BUG-0011224-fixed-MFC-build-in-VS2010_b.patch
2010-10-18 14:40McBenNote Added: 0022524
2010-12-22 09:40David ColeRelationship addedrelated to 0011213
2010-12-22 09:42David ColeRelationship addedrelated to 0011638
2010-12-22 09:46David ColeNote Added: 0024321
2010-12-22 09:47David ColeAssigned To => David Cole
2010-12-22 09:47David ColeStatusnew => assigned
2011-03-15 10:07ThomasZymaraNote Added: 0025784
2011-10-04 05:34Gunther LaureNote Added: 0027520
2011-10-21 12:21David ColeTarget Version => CMake 2.8.7
2011-11-04 13:43David ColeNote Added: 0027722
2011-11-04 13:43David ColeStatusassigned => resolved
2011-11-04 13:43David ColeFixed in Version => CMake 2.8.7
2011-11-04 13:43David ColeResolutionopen => fixed
2011-11-04 13:45David ColeNote Added: 0027725
2012-04-02 10:10David ColeNote Added: 0029039
2012-04-02 10:10David ColeStatusresolved => closed

Notes
(0022463)
McBen   
2010-10-09 13:38   
The tag "<UseOfMfc>" has 3 states: false,Static,Dynamic
CMake incorrectly only writes false or true.

I attached a possible patched for that.
(0022524)
McBen   
2010-10-18 14:40   
new patch added.
'cause I missed a NULL_pointer check in my first patch.

( "0001-BUG-0011224-fixed-MFC-build-in-VS2010.patch" can be deleted )
(0024321)
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.
(0025784)
ThomasZymara   
2011-03-15 10:07   
I just verified your fix and it worked
(0027520)
Gunther Laure   
2011-10-04 05:34   
Are we forced to apply this patch on our own or will it be added to a CMake release soon?
(0027722)
David Cole   
2011-11-04 13:43   
Fix pushed to 'next':

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=011694c269a1193ec8f7fe8dce8d4a86bcafa8e4 [^]
(0027725)
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...
(0029039)
David Cole   
2012-04-02 10:10   
Closing resolved issues that have not been updated in more than 4 months.