summaryrefslogtreecommitdiffstats
path: root/Modules/FindMFC.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/FindMFC.cmake')
-rw-r--r--Modules/FindMFC.cmake10
1 files changed, 4 insertions, 6 deletions
diff --git a/Modules/FindMFC.cmake b/Modules/FindMFC.cmake
index 0574ab5..2d5de89 100644
--- a/Modules/FindMFC.cmake
+++ b/Modules/FindMFC.cmake
@@ -29,21 +29,19 @@ endif()
if(MFC_ATTEMPT_TRY_COMPILE)
if(NOT DEFINED MFC_HAVE_MFC)
set(CHECK_INCLUDE_FILE_VAR "afxwin.h")
- configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx)
+ file(READ ${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in _CIF_SOURCE_CONTENT)
+ string(CONFIGURE "${_CIF_SOURCE_CONTENT}" _CIF_SOURCE_CONTENT)
message(CHECK_START "Looking for MFC")
# Try both shared and static as the root project may have set the /MT flag
try_compile(MFC_HAVE_MFC
- SOURCES ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
+ SOURCE_FROM_VAR CheckIncludeFile.cxx _CIF_SOURCE_CONTENT
CMAKE_FLAGS
-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
- SOURCES ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
+ SOURCE_FROM_VAR CheckIncludeFile.cxx _CIF_SOURCE_CONTENT
CMAKE_FLAGS
-DCMAKE_MFC_FLAG:STRING=1
OUTPUT_VARIABLE OUTPUT)