Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cmake-properties.qdoc
Go to the documentation of this file.
1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5\group cmake-target-properties-qttest
6\title CMake Target Properties in Qt6 Test
7\brief Lists CMake target properties known to Qt6::Test.
8
9\l{Qt Test} module knows about the following CMake target properties:
10
11\sa{CMake Property Reference}
12*/
13
14/*!
15\page cmake-target-property-qt-skip-default-testcase-dirs.html
16\ingroup cmake-properties-qttest
17\ingroup cmake-target-properties-qttest
18
19\title QT_SKIP_DEFAULT_TESTCASE_DIRS
20\target cmake-target-property-QT_SKIP_DEFAULT_TESTCASE_DIRS
21
22\cmakepropertysince 6.9
23\preliminarycmakeproperty
24
25\brief Disables the test case directory definitions for targets that link
26 to the Test library.
27
28The property disables the following compile-time definitions for the target:
29\list
30\li QT_TESTCASE_SOURCEDIR
31\li QT_TESTCASE_BUILDDIR
32\endlist
33
34By default, these definitions point to the source and build directories
35of the target. Since they are only defined for this target, they preclude
36sharing precompiled headers with the compilation of other targets. If
37\c QT_SKIP_DEFAULT_TESTCASE_DIRS is set to \c TRUE these definitions are
38omitted, avoiding this limitation.
39
40\badcode
41qt_add_executable(mytest main.cpp)
42set_property(TARGET mytest PROPERTY QT_SKIP_DEFAULT_TESTCASE_DIRS TRUE)
43target_link_libraries(mytest PRIVATE Qt6::Test)
44\endcode
45The \c QT_TESTCASE_SOURCEDIR and \c QT_TESTCASE_BUILDDIR macros will remain
46undefined when compiling \c mytest.
47
48The value of the property defaults to the value of the
49\l {cmake-variable-QT_SKIP_DEFAULT_TESTCASE_DIRS}{QT_SKIP_DEFAULT_TESTCASE_DIRS}
50variable.
51
52\sa QFINDTESTDATA,
53 {cmake-variable-QT_SKIP_DEFAULT_TESTCASE_DIRS}{QT_SKIP_DEFAULT_TESTCASE_DIRS}
54*/