CMAKE编译MFC工程

CMAKE编译MFC工程

老外真辛苦:

http://stackoverflow.com/questions/11580748/using-cmake-for-making-a-project-which-includes-mfc

http://www.cmake.org/Wiki/CMake_FAQ

You need to add _AFXDLL to the preprocessor definitions and set the CMake variable CMAKE_MFC_FLAG to 1 for the static MFC library, or 2 for the shared one.

add_definitions(-D_AFXDLL)
set(CMAKE_MFC_FLAG 1)

For further info run

cmake --help-variable CMAKE_MFC_FLAG

你可能感兴趣的:(CMAKE编译MFC工程)