MantisBT - CMake
View Issue Details
0014903CMakeModulespublic2014-05-05 03:352015-04-27 10:01
Felix Krause 
Brad King 
normalminoralways
closedfixed 
Microsoft Visual Studio 2013Windowsany
CMake 2.8.12.2 
CMake 3.0CMake 3.0 
0014903: InstallRequiredSystemLibraries CMAKE_INSTALL_MFC_LIBRARIES does not work with MSVC 2013
The MBCS (Multi-Byte Character Set) has been deprecated with VC 2013, and MSVC no longer ships with an MBCS-version of MFC by default. However, it can be downloaded as an add-on here [1].

The InstallRequiredSystemLibraries module requires the MBCS version of the library even if the unicode version is used. So the user has to install an add-on he does not use just to be able to use the module.


 [1]: http://msdn.microsoft.com/en-us/library/dn251007.aspx [^]
Install Visual Studio 2013 Professional and select the MFC libraries as optional component (otherwise they won't be available at all).

Create a CMake project with these lines:

    set(CMAKE_INSTALL_MFC_LIBRARIES ON)
    include(InstallRequiredSystemLibraries)

Try to create an MSVC 2013 project with it. You get the following error:

    CMake Warning at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/InstallRequiredSystemLibraries.cmake:351 (message):
      system runtime library file does not exist: 'C:/Program Files
      (x86)/Microsoft Visual Studio
      12.0/VC/redist/x86/Microsoft.VC120.MFC/mfc120.dll'
The patch attached removes the dependency on the MBCS version for MSVC 12 (= 2013) onward.
No tags attached.
related to 0015531closed  InstallRequiredSystemLibraries misses MBCS MFC libraries 
patch InstallRequiredSystemLibraries.patch (1,558) 2014-05-05 03:35
https://public.kitware.com/Bug/file/5140/InstallRequiredSystemLibraries.patch
patch InstallRequiredSystemLibraries2.patch (2,059) 2014-05-06 02:31
https://public.kitware.com/Bug/file/5143/InstallRequiredSystemLibraries2.patch
Issue History
2014-05-05 03:35Felix KrauseNew Issue
2014-05-05 03:35Felix KrauseFile Added: InstallRequiredSystemLibraries.patch
2014-05-05 09:06Brad KingNote Added: 0035815
2014-05-05 10:17Brad KingSummaryInstallRequiredSystemLibraries does not work with MSVC 2013 => InstallRequiredSystemLibraries CMAKE_INSTALL_MFC_LIBRARIES does not work with MSVC 2013
2014-05-06 02:31Felix KrauseFile Added: InstallRequiredSystemLibraries2.patch
2014-05-06 02:32Felix KrauseNote Added: 0035823
2014-05-06 10:00Brad KingNote Added: 0035827
2014-05-06 10:10Brad KingNote Added: 0035828
2014-05-06 10:10Brad KingAssigned To => Brad King
2014-05-06 10:10Brad KingStatusnew => resolved
2014-05-06 10:10Brad KingResolutionopen => fixed
2014-05-06 10:10Brad KingFixed in Version => CMake 3.0
2014-05-06 10:10Brad KingTarget Version => CMake 3.0
2014-11-03 08:38Robert MaynardNote Added: 0037129
2014-11-03 08:38Robert MaynardStatusresolved => closed
2015-04-27 10:01Brad KingRelationship addedrelated to 0015531

Notes
(0035815)
Brad King   
2014-05-05 09:06   
Thanks. If someone *does* install the add-on then we should still have an option to install the MBCS libs too. Please revise the patch to use if(EXISTS) or some other way to optionally get them.
(0035823)
Felix Krause   
2014-05-06 02:32   
You're right, I updated the patch.
(0035827)
Brad King   
2014-05-06 10:00   
Thanks. Applied with minor tweaks:

 InstallRequiredSystemLibraries: MBCS MFC is optional on VS 12
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c0a6646d [^]
(0035828)
Brad King   
2014-05-06 10:10   
This has been scheduled for inclusion in the next 3.0 release candidate.
(0037129)
Robert Maynard   
2014-11-03 08:38   
Closing resolved issues that have not been updated in more than 4 months.