diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindMFC.cmake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Modules/FindMFC.cmake b/Modules/FindMFC.cmake index 5c2dbbf..3baaf32 100644 --- a/Modules/FindMFC.cmake +++ b/Modules/FindMFC.cmake @@ -31,6 +31,7 @@ if(MFC_ATTEMPT_TRY_COMPILE) configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx) message(STATUS "Looking for MFC") + # Try both shared and static as the root project may have set the /MT flag try_compile(MFC_HAVE_MFC ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx @@ -38,6 +39,16 @@ if(MFC_ATTEMPT_TRY_COMPILE) -DCMAKE_MFC_FLAG:STRING=2 -DCOMPILE_DEFINITIONS:STRING=-D_AFXDLL OUTPUT_VARIABLE OUTPUT) + if(NOT MFC_HAVE_MFC) + configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx) + try_compile(MFC_HAVE_MFC + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx + CMAKE_FLAGS + -DCMAKE_MFC_FLAG:STRING=1 + OUTPUT_VARIABLE OUTPUT) + endif() if(MFC_HAVE_MFC) message(STATUS "Looking for MFC - found") set(MFC_HAVE_MFC 1 CACHE INTERNAL "Have MFC?") |