Only install tests data for prefix builds

If we install tests data for non-prefix builds it can cause tests to
fail as they find the data in the wrong location. An example of this is
tst_qsslkey.

Change-Id: I55bd2ff4cb5a0857dc857cb2149ffe4436ec6f99
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
bb10
Leander Beernaert 2020-02-12 15:37:12 +01:00
parent ba165cae71
commit 540bd6cf20
1 changed files with 2 additions and 2 deletions

View File

@ -2797,11 +2797,11 @@ function(qt_add_test name)
foreach(testdata IN LISTS arg_TESTDATA)
set(testdata "${CMAKE_CURRENT_SOURCE_DIR}/${testdata}")
if (IS_DIRECTORY "${testdata}")
qt_copy_or_install(
qt_install(
DIRECTORY "${testdata}"
DESTINATION "${testdata_install_dir}")
else()
qt_copy_or_install(
qt_install(
FILES "${testdata}"
DESTINATION "${testdata_install_dir}")
endif()