diff options
author | David Cole <david.cole@kitware.com> | 2011-11-01 20:27:24 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2011-11-01 20:27:24 (GMT) |
commit | 54595e6d89a6280dfbc9580500ce50283ce71d3f (patch) | |
tree | 914be5937a3410f84c06ec7791e4d5aa50afdee1 | |
parent | 36b0c432cf5804ec45367066e34f4c38165d5c09 (diff) | |
download | CMake-54595e6d89a6280dfbc9580500ce50283ce71d3f.zip CMake-54595e6d89a6280dfbc9580500ce50283ce71d3f.tar.gz CMake-54595e6d89a6280dfbc9580500ce50283ce71d3f.tar.bz2 |
Tests: Avoid MFC test automatically for VCExpress builds (#11213)
-rw-r--r-- | Tests/CMakeLists.txt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index f400f6d..27018d1 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1210,6 +1210,30 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ 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() endif() endif() |