[Cmake-commits] CMake branch, next, updated. v2.8.6-2267-gb248927
David Cole
david.cole at kitware.com
Fri Dec 16 16:41:12 EST 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via b248927241b1e7a2bf17b27ff64ff4341876ee5f (commit)
via 0e598b7bcd2da655b23e02bef4e56e620c6286c5 (commit)
from f3d7f3049c2e4b4570b885c660591a788330a84c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b248927241b1e7a2bf17b27ff64ff4341876ee5f
commit b248927241b1e7a2bf17b27ff64ff4341876ee5f
Merge: f3d7f30 0e598b7
Author: David Cole <david.cole at kitware.com>
AuthorDate: Fri Dec 16 16:41:11 2011 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Dec 16 16:41:11 2011 -0500
Merge topic 'avoid-mfc-test' into next
0e598b7 Tests: Only really run MFC test if we can build MFC apps (#11213)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0e598b7bcd2da655b23e02bef4e56e620c6286c5
commit 0e598b7bcd2da655b23e02bef4e56e620c6286c5
Author: David Cole <david.cole at kitware.com>
AuthorDate: Fri Dec 16 13:49:27 2011 -0500
Commit: David Cole <david.cole at kitware.com>
CommitDate: Fri Dec 16 16:30:10 2011 -0500
Tests: Only really run MFC test if we can build MFC apps (#11213)
Avoid problems on "undetected" VS Express build environments.
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 1851f7a..939bd21 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1244,6 +1244,56 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
set(CTEST_RUN_MFC OFF)
endif()
endif()
+
+ # Last resort, after quick checks are done. Do a try_compile, and avoid
+ # the MFC test if the simplest possible MFC app cannot be compiled.
+ if(CTEST_RUN_MFC AND NOT DEFINED HAVE_MFC)
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/MFC/try_compile/CMakeLists.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/MFC/try_compile/CMakeLists.txt
+ COPYONLY
+ )
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/MFC/mfc1/stdafx.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/MFC/try_compile/stdafx.cpp
+ COPYONLY
+ )
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/MFC/mfc1/stdafx.h
+ ${CMAKE_CURRENT_BINARY_DIR}/MFC/try_compile/stdafx.h
+ COPYONLY
+ )
+
+ message(STATUS "Looking for MFC")
+
+ try_compile(HAVE_MFC
+ ${CMAKE_CURRENT_BINARY_DIR}/MFC/try_compile/build
+ ${CMAKE_CURRENT_BINARY_DIR}/MFC/try_compile
+ try_compile_mfc
+ OUTPUT_VARIABLE HAVE_MFC_OUTPUT)
+
+ if(HAVE_MFC)
+ message(STATUS "Looking for MFC - found")
+ set(HAVE_MFC 1 CACHE INTERNAL "Have MFC")
+ file(APPEND
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Determining if MFC exists passed with the following output:\n"
+ "${HAVE_MFC_OUTPUT}\n\n")
+ else()
+ message(STATUS "Looking for MFC - not found")
+ set(HAVE_MFC "" CACHE INTERNAL "Have MFC")
+ file(APPEND
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Determining if MFC exists failed with the following output:\n"
+ "${HAVE_MFC_OUTPUT}\n\n")
+ endif()
+ endif()
+
+ if(CTEST_RUN_MFC AND NOT HAVE_MFC)
+ message(STATUS
+ "cannot compile simplest ever MFC app, avoiding MFC test")
+ set(CTEST_RUN_MFC OFF)
+ endif()
endif()
endif()
diff --git a/Tests/MFC/try_compile/CMakeLists.txt b/Tests/MFC/try_compile/CMakeLists.txt
new file mode 100644
index 0000000..8e5d746
--- /dev/null
+++ b/Tests/MFC/try_compile/CMakeLists.txt
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 2.8)
+project(try_compile_mfc)
+
+set(files
+ stdafx.cpp
+ stdafx.h
+)
+
+set(CMAKE_MFC_FLAG "2")
+
+# VS generators add this automatically based on the CMAKE_MFC_FLAG value,
+# but generators matching "Make" require:
+add_definitions(-D_AFXDLL)
+
+add_executable(simplest_possible_mfc_exe WIN32 ${files})
-----------------------------------------------------------------------
Summary of changes:
Tests/CMakeLists.txt | 50 ++++++++++++++++++++++++++++++++++
Tests/MFC/try_compile/CMakeLists.txt | 15 ++++++++++
2 files changed, 65 insertions(+), 0 deletions(-)
create mode 100644 Tests/MFC/try_compile/CMakeLists.txt
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list