summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-07-11 11:39:11 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-07-11 11:39:15 (GMT)
commit79e72f4b7c18cdb758e945daff0f9d201625c8f6 (patch)
tree0bd5e4d2b8cbfc39341255ee022b22f4bc23c844 /Modules
parentde72d5dda6909093eb3fb6f8c0d53633e5bd9fdf (diff)
parent6b2bf5756bd01a955606f1963ad44bfde21f173f (diff)
downloadCMake-79e72f4b7c18cdb758e945daff0f9d201625c8f6.zip
CMake-79e72f4b7c18cdb758e945daff0f9d201625c8f6.tar.gz
CMake-79e72f4b7c18cdb758e945daff0f9d201625c8f6.tar.bz2
Merge topic 'FindMFC-try-static'
6b2bf575 FindMFC: Check for static MFC variant Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1034
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindMFC.cmake11
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?")