diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2012-07-10 17:56:54 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-11 12:46:15 +0200 |
commit | 78203ccf8047151fd12a39816b2e15e210414388 (patch) | |
tree | 07609cb4048362002ece77a44a8f83274ec91609 /src/corelib | |
parent | 27cefd85f3e70b4d5e31261710e4361814c742dd (diff) |
Fix unit tests when CMAKE_PREFIX_PATH env var is not set.
Tests which are expected to not build need to get a way to find the
Qt 5 config packages. Because they use try_compile, there is no way
to pass the contents to it.
Work around that by generating a file containing the prefix which
the tests will include.
Change-Id: If43080c241539e4af5fe1c183e7da72066278b73
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/Qt5CTestMacros.cmake | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake index a6d8adfc7d..468c42e0b2 100644 --- a/src/corelib/Qt5CTestMacros.cmake +++ b/src/corelib/Qt5CTestMacros.cmake @@ -17,6 +17,9 @@ macro(expect_fail _dir) string(REPLACE ")" "_" testname "${testname}") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/failbuild/${_dir}") file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/${_dir}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/failbuild/${_dir}") + + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/failbuild/${_dir}/${_dir}/FindPackageHints.cmake" "set(Qt5Tests_PREFIX_PATH \"${CMAKE_PREFIX_PATH}\")") + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/failbuild/${_dir}/CMakeLists.txt" " cmake_minimum_required(VERSION 2.8) |