qt_skip_default_testcase_dirs
该变量在 Qt 6.9 中引入。
注意: 此变量为技术预览版,在未来版本中可能会更改。
禁用Qt Test 目标的测试用例目录定义。
控制QT_SKIP_DEFAULT_TESTCASE_DIRS目标属性的默认值。
注意: CMake 版本 >= 3.23 支持。
set(QT_SKIP_DEFAULT_TESTCASE_DIRS TRUE) ... qt_add_executable(mytest1 main1.cpp) target_link_libraries(mytest1 PRIVATE Qt6::Test) ... qt_add_executable(mytest2 main2.cpp) target_link_libraries(mytest2 PRIVATE Qt6::Test)
编译mytest1
和mytest2
时,QT_TESTCASE_SOURCEDIR
和QT_TESTCASE_BUILDDIR
宏将保持未定义状态。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.