summaryrefslogtreecommitdiffstats
path: root/src/testlib/Qt5TestConfigExtras.cmake.in
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-06-04 12:07:20 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-06-04 10:14:39 +0000
commit5c954b89a9bd94b085a49d05dfa25644b2eda1c8 (patch)
tree4f7a392af74a9db67167a118c351c35f77cac330 /src/testlib/Qt5TestConfigExtras.cmake.in
parentfae5691c7f78f8a0154c9cea28b6639327a90550 (diff)
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 <ville.voutilainen@qt.io>
Diffstat (limited to 'src/testlib/Qt5TestConfigExtras.cmake.in')
-rw-r--r--src/testlib/Qt5TestConfigExtras.cmake.in1
1 files changed, 0 insertions, 1 deletions
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}")