1 # - Locate MFC libraries
\r
2 # This module defines
\r
3 # MFC_FOUND, if false, do not try to link to MFC
\r
4 # MFC_LIBRARY_DIR, where to find libraries
\r
5 # MFC_INCLUDE_DIR, where to find headers
\r
7 IF(CustomMFC_FIND_REQUIRED)
\r
8 SET(MFC_FIND_REQUIRED TRUE)
\r
12 # If MFC have been found, remember their directory
\r
14 SET(MFC_STANDARD_DIR "${VC_DIR}/atlmfc")
\r
24 # Display an error message if MFC are not found, MFC_FOUND is updated
\r
25 # User will be able to update MFC_DIR to the correct directory
\r
26 INCLUDE(FindPackageHandleStandardArgs)
\r
27 FIND_PACKAGE_HANDLE_STANDARD_ARGS(MFC DEFAULT_MSG MFC_DIR)
\r
30 SET(MFC_INCLUDE_DIR "${MFC_DIR}/include")
\r
31 INCLUDE_DIRECTORIES(${MFC_INCLUDE_DIR})
\r
33 # Using 32 or 64 bits libraries
\r
35 SET(MFC_LIBRARY_DIR "${MFC_DIR}/lib/amd64")
\r
37 SET(MFC_LIBRARY_DIR "${MFC_DIR}/lib")
\r
40 # Add MFC libraries directory to default library path
\r
41 LINK_DIRECTORIES(${MFC_LIBRARY_DIR})
\r
43 # Set definitions for using MFC in DLL
\r
44 SET(MFC_DEFINITIONS -D_AFXDLL -DUNICODE -D_UNICODE)
\r
46 # Set CMake flag to use MFC DLL
\r
47 SET(CMAKE_MFC_FLAG 2)
\r
50 # TODO: create a macro which set MFC_DEFINITIONS, MFC_LIBRARY_DIR and MFC_INCLUDE_DIR for a project
\r