summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLists.txt
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-11-15 19:38:52 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-11-15 19:38:52 (GMT)
commit608d05b469a446aeb85c0d3374ccf2a3f397292b (patch)
treedbabf801eb8905387ce13bfb6c537266f8be47e5 /Tests/CMakeLists.txt
parent151850ed0345ed6353b2b836ffe00da0e448b50b (diff)
parentc71f7ab7db843234cab7e6b75ab2636a0d7e8d67 (diff)
downloadCMake-608d05b469a446aeb85c0d3374ccf2a3f397292b.zip
CMake-608d05b469a446aeb85c0d3374ccf2a3f397292b.tar.gz
CMake-608d05b469a446aeb85c0d3374ccf2a3f397292b.tar.bz2
Merge topic 'add-mfc-test'
c71f7ab Tests: Avoid MFC test automatically for Watcom WMake builds (#11213) a42e3f2 Tests: Fix MFC test for old vs6 dashboards (#11213) b297da6 Tests: Fix MFC test w/ Make-based generators (#11213) 54595e6 Tests: Avoid MFC test automatically for VCExpress builds (#11213) 36b0c43 Tests: Add the MFC test (#11213)
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r--Tests/CMakeLists.txt55
1 files changed, 55 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 21d1196..28c6261 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1206,6 +1206,61 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean")
ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile")
+ if(NOT DEFINED CTEST_RUN_MFC)
+ set(CTEST_RUN_MFC OFF)
+
+ if(MSVC)
+ set(CTEST_RUN_MFC ON)
+
+ # Look for evidence that this is a VCExpress build. If so, avoid
+ # the MFC test by default.
+ string(TOLOWER "${CMAKE_TEST_MAKEPROGRAM}" mkprog)
+ if(mkprog MATCHES "vcexpress")
+ message(STATUS
+ "CMAKE_TEST_MAKEPROGRAM indicates vcexpress, avoiding MFC test")
+ set(CTEST_RUN_MFC OFF)
+ endif()
+
+ # Since MSBuild might also be the "makeprogram" for a VCExpress
+ # build tree, use one more heuristic, too. The string representing
+ # the .vcproj file type contains "VCExpress" on machines where an
+ # express edition of VS was installed last:
+ if(CTEST_RUN_MFC)
+ execute_process(COMMAND cmd /c assoc .vcproj
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ OUTPUT_VARIABLE ov)
+ if(ov MATCHES "VCExpress")
+ message(STATUS
+ ".vcproj file association indicates VCExpress, avoiding MFC test")
+ set(CTEST_RUN_MFC OFF)
+ endif()
+ endif()
+
+ # For the Watcom WMake generator, avoid the MFC test by default.
+ if(CTEST_RUN_MFC)
+ if("${CMAKE_TEST_GENERATOR}" MATCHES "WMake")
+ message(STATUS
+ "using the Watcom WMake generator, avoiding MFC test")
+ set(CTEST_RUN_MFC OFF)
+ endif()
+ endif()
+ endif()
+ endif()
+
+ if(CTEST_RUN_MFC)
+ add_test(MFC ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/MFC"
+ "${CMake_BINARY_DIR}/Tests/MFC"
+ --build-two-config
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-project mfc_driver
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --test-command ${CMAKE_CTEST_COMMAND}
+ -C \${CTEST_CONFIGURATION_TYPE} -VV)
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MFC")
+ endif()
+
IF(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio")
ADD_TEST(VSExternalInclude ${CMAKE_CTEST_COMMAND}
--build-and-test