From 5c954b89a9bd94b085a49d05dfa25644b2eda1c8 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 4 Jun 2019 12:07:20 +0200 Subject: Fix qFindTestData with cmake and ninja generator In order for test lib to locate the file requested via QFINDTESTDATA, it needs the build directory of the test (for example $builddir/tests/auto/foo/bar) and __FILE__ expanding to a path to the source relative to this build directory. With ninja, __FILE__ is a path that is always relative to the top-level build directory, not the per-test case one. Therefore the path resolution in testlib fails. To accommodate this, add_qt_test() now always sets QT_TESTCASE_BUILDDIR as well as the newly introduced QT_TESTCASE_SOURCEDIR, which, as an absolute path, removes the need to use __FILE__. Change-Id: I16c2b0001e38162e6da9fdb1a61f4f8ce634fe46 Reviewed-by: Ville Voutilainen --- src/testlib/Qt5TestConfigExtras.cmake.in | 1 - 1 file changed, 1 deletion(-) delete mode 100644 src/testlib/Qt5TestConfigExtras.cmake.in (limited to 'src/testlib/Qt5TestConfigExtras.cmake.in') diff --git a/src/testlib/Qt5TestConfigExtras.cmake.in b/src/testlib/Qt5TestConfigExtras.cmake.in deleted file mode 100644 index 86a706ea9d..0000000000 --- a/src/testlib/Qt5TestConfigExtras.cmake.in +++ /dev/null @@ -1 +0,0 @@ -set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Test APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS QT_TESTCASE_BUILDDIR="${CMAKE_BINARY_DIR}") -- cgit v1.2.3