Fixed: MFC can't be found

This commit is contained in:
kervala 2013-10-30 20:46:19 +01:00
parent 25c7eec853
commit 48c6c213c6

View file

@ -8,14 +8,11 @@ IF(CustomMFC_FIND_REQUIRED)
SET(MFC_FIND_REQUIRED TRUE) SET(MFC_FIND_REQUIRED TRUE)
ENDIF(CustomMFC_FIND_REQUIRED) ENDIF(CustomMFC_FIND_REQUIRED)
# Try to find MFC using official module, MFC_FOUND is set
FIND_PACKAGE(MFC)
IF(NOT MFC_DIR) IF(NOT MFC_DIR)
# If MFC have been found, remember their directory # If MFC have been found, remember their directory
IF(MFC_FOUND AND VC_DIR) IF(VC_DIR)
SET(MFC_STANDARD_DIR "${VC_DIR}/atlmfc") SET(MFC_STANDARD_DIR "${VC_DIR}/atlmfc")
ENDIF(MFC_FOUND AND VC_DIR) ENDIF(VC_DIR)
FIND_PATH(MFC_DIR FIND_PATH(MFC_DIR
include/afxwin.h include/afxwin.h
@ -45,6 +42,9 @@ IF(MFC_FOUND)
# Set definitions for using MFC in DLL # Set definitions for using MFC in DLL
SET(MFC_DEFINITIONS -D_AFXDLL) SET(MFC_DEFINITIONS -D_AFXDLL)
# Set CMake flag to use MFC DLL
SET(CMAKE_MFC_FLAG 2)
ENDIF(MFC_FOUND) ENDIF(MFC_FOUND)
# TODO: create a macro which set MFC_DEFINITIONS, MFC_LIBRARY_DIR and MFC_INCLUDE_DIR for a project # TODO: create a macro which set MFC_DEFINITIONS, MFC_LIBRARY_DIR and MFC_INCLUDE_DIR for a project