FindMFC

Finds the native Microsoft Foundation Class Library (MFC) for developing MFC applications on Windows.

備註

MFC is an optional component in Visual Studio and must be installed separately for this module to succeed.

Once the MFC libraries and headers are found, no additional manual linking is needed, as they are part of the development environment.

結果變數

This module defines the following variables:

MFC_FOUND

Boolean indicating whether MFC support is found.

範例

Using this module to check if the application can link to the MFC libraries:

find_package(MFC)

if(MFC_FOUND)
  # Example logic when MFC is available...
  set(CMAKE_MFC_FLAG 2)
  add_executable(app WIN32 main.cpp)
  target_compile_definitions(app PRIVATE _AFXDLL)
endif()

另請參見