summaryrefslogtreecommitdiffstats
path: root/tests/auto/cmake/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2021-03-24 12:58:08 +0100
committerAlexey Edelev <alexey.edelev@qt.io>2021-04-08 13:16:41 +0200
commit70464b355ec1c7007e0b1291f733e2540ba1825f (patch)
tree36113b6e6c9fa80804c7a34c2d3cb90e7956cbb4 /tests/auto/cmake/CMakeLists.txt
parent1999e2adc12a66488b241ff0e00c8716bd217c0a (diff)
Specify QT_TESTCASE_BUILDDIR for Qt::Test users implicitly
QT_TESTCASE_BUILDDIR was implicitly defined by Qt::Test target for library users in Qt5. By default, this definition will point to CMAKE_CURRENT_BINARY_DIR. This logic works similarly to qmake logic. From user's perspective it might be useful to not rely on standard search paths, but specify own. This can be done by setting the QT_TESTCASE_BUILDDIR property for the user's target. CMake will substute the value of the QT_TESTCASE_BUILDDIR property into the QT_TESTCASE_BUILDDIR definition. The implicit QT_TESTCASE_SOURCEDIR also seems to be useful. According to the current logic, it points to CMAKE_CURRENT_SOURCE_DIR. Fixes: QTBUG-92079 Change-Id: I8a9065f08e859c713b3c8cc08142a9ced0677770 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'tests/auto/cmake/CMakeLists.txt')
-rw-r--r--tests/auto/cmake/CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 4fb6c24d8d..a94f1a51fe 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -112,6 +112,10 @@ if (CMAKE_GENERATOR STREQUAL Ninja AND UNIX AND NOT WIN32)
BINARY "tests/test_QFINDTESTDATA"
SIMULATE_IN_SOURCE
)
+ _qt_internal_test_expect_pass(test_QT_TESTCASE_BUILDDIR
+ BINARY "test_qt_testcase_builddir"
+ SIMULATE_IN_SOURCE
+ )
endif()
if (NOT NO_DBUS)