summaryrefslogtreecommitdiffstats
path: root/tests/auto/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/cmake')
-rw-r--r--tests/auto/cmake/CMakeLists.txt157
-rw-r--r--tests/auto/cmake/mockplugins/.cmake.conf2
-rw-r--r--tests/auto/cmake/mockplugins/CMakeLists.txt6
-rw-r--r--tests/auto/cmake/mockplugins/mock1plugin/CMakeLists.txt4
-rw-r--r--tests/auto/cmake/mockplugins/mock1plugin/qmock1plugin.h2
-rw-r--r--tests/auto/cmake/mockplugins/mock2plugin/CMakeLists.txt4
-rw-r--r--tests/auto/cmake/mockplugins/mock2plugin/qmock2plugin.h2
-rw-r--r--tests/auto/cmake/mockplugins/mock3plugin/CMakeLists.txt4
-rw-r--r--tests/auto/cmake/mockplugins/mock3plugin/qmock3plugin.h2
-rw-r--r--tests/auto/cmake/mockplugins/mock4plugin/CMakeLists.txt4
-rw-r--r--tests/auto/cmake/mockplugins/mock4plugin/qmock4plugin.h2
-rw-r--r--tests/auto/cmake/mockplugins/mock5plugin/CMakeLists.txt4
-rw-r--r--tests/auto/cmake/mockplugins/mock5plugin/qmock5plugin.h2
-rw-r--r--tests/auto/cmake/mockplugins/mock6plugin/CMakeLists.txt4
-rw-r--r--tests/auto/cmake/mockplugins/mock6plugin/qmock6plugin.h2
-rw-r--r--tests/auto/cmake/mockplugins/mockplugins1/CMakeLists.txt5
-rw-r--r--tests/auto/cmake/mockplugins/mockplugins1/fake.cpp2
-rw-r--r--tests/auto/cmake/mockplugins/mockplugins1/qmockplugin.h6
-rw-r--r--tests/auto/cmake/mockplugins/mockplugins2/CMakeLists.txt4
-rw-r--r--tests/auto/cmake/mockplugins/mockplugins2/fake.cpp2
-rw-r--r--tests/auto/cmake/mockplugins/mockplugins3/CMakeLists.txt5
-rw-r--r--tests/auto/cmake/mockplugins/mockplugins3/fake.cpp2
-rw-r--r--tests/auto/cmake/mockplugins/mockplugins3/qmockauxplugin.h6
-rw-r--r--tests/auto/cmake/test(needsquoting)dirname/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test(needsquoting)dirname/mywidget.cpp2
-rw-r--r--tests/auto/cmake/test(needsquoting)dirname/mywidget.h2
-rw-r--r--tests/auto/cmake/test_QFINDTESTDATA/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_QFINDTESTDATA/tests/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_QFINDTESTDATA/tests/main.cpp2
-rw-r--r--tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_QTBUG-63422/mywidget.cpp2
-rw-r--r--tests/auto/cmake/test_QTBUG-63422/mywidget.h2
-rw-r--r--tests/auto/cmake/test_QTP0003/CMakeLists.txt66
-rw-r--r--tests/auto/cmake/test_QTP0003/source.cpp4
-rw-r--r--tests/auto/cmake/test_QT_TESTCASE_BUILDDIR/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_QT_TESTCASE_BUILDDIR/main.cpp2
-rw-r--r--tests/auto/cmake/test_add_big_resource/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_add_big_resource/myobject.cpp2
-rw-r--r--tests/auto/cmake/test_add_big_resource/myobject.h2
-rw-r--r--tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_add_binary_resources_delayed_file/main.cpp2
-rw-r--r--tests/auto/cmake/test_add_resource_options/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_add_resource_options/myobject.cpp2
-rw-r--r--tests/auto/cmake/test_add_resource_options/myobject.h2
-rw-r--r--tests/auto/cmake/test_add_resource_prefix/CMakeLists.txt25
-rw-r--r--tests/auto/cmake/test_add_resource_prefix/main.cpp26
-rw-r--r--tests/auto/cmake/test_add_resource_prefix/resource_file.txt1
-rw-r--r--tests/auto/cmake/test_add_resources_big_resources/CMakeLists.txt45
-rw-r--r--tests/auto/cmake/test_add_resources_big_resources/intermediate_lib.cpp20
-rw-r--r--tests/auto/cmake/test_add_resources_big_resources/intermediate_lib.h9
-rw-r--r--tests/auto/cmake/test_add_resources_big_resources/leaf_lib.cpp13
-rw-r--r--tests/auto/cmake/test_add_resources_big_resources/leaf_lib.h8
-rw-r--r--tests/auto/cmake/test_add_resources_big_resources/main.cpp35
-rw-r--r--tests/auto/cmake/test_add_resources_big_resources/resource1.txt1
-rw-r--r--tests/auto/cmake/test_add_resources_big_resources/resource2.txt1
-rw-r--r--tests/auto/cmake/test_add_resources_big_resources/resource3.txt1
-rw-r--r--tests/auto/cmake/test_add_resources_binary_generated/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_add_resources_binary_generated/main.cpp2
-rw-r--r--tests/auto/cmake/test_add_resources_delayed_file/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_add_resources_delayed_file/main.cpp2
-rw-r--r--tests/auto/cmake/test_android_multi_abi_forward_vars/CMakeLists.txt33
-rw-r--r--tests/auto/cmake/test_android_multi_abi_forward_vars/main.cpp4
-rw-r--r--tests/auto/cmake/test_build_simple_widget_app/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_build_simple_widget_app/main.cpp2
-rw-r--r--tests/auto/cmake/test_build_simple_widget_app/test_build_simple_widget_app.pro5
-rw-r--r--tests/auto/cmake/test_collecting_plugins/CMakeLists.txt31
-rw-r--r--tests/auto/cmake/test_collecting_plugins/main.cpp7
-rw-r--r--tests/auto/cmake/test_collecting_plugins/plugin.cpp18
-rw-r--r--tests/auto/cmake/test_concurrent_module/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_concurrent_module/main.cpp2
-rw-r--r--tests/auto/cmake/test_config_expressions/CMakeLists.txt134
-rw-r--r--tests/auto/cmake/test_dbus_module/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_dbus_module/mydbusobject.cpp2
-rw-r--r--tests/auto/cmake/test_dbus_module/mydbusobject.h2
-rw-r--r--tests/auto/cmake/test_dependent_modules/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_dependent_modules/mywidget.cpp2
-rw-r--r--tests/auto/cmake/test_dependent_modules/mywidget.h2
-rw-r--r--tests/auto/cmake/test_egl_lib/main.cpp2
-rw-r--r--tests/auto/cmake/test_generating_cpp_exports/.cmake.conf2
-rw-r--r--tests/auto/cmake/test_generating_cpp_exports/CMakeLists.txt5
-rw-r--r--tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/CMakeLists.txt5
-rw-r--r--tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/module_api.cpp2
-rw-r--r--tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/module_api.h7
-rw-r--r--tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/use_api.cpp2
-rw-r--r--tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/CMakeLists.txt5
-rw-r--r--tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/module_api.cpp2
-rw-r--r--tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/module_api.h7
-rw-r--r--tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/use_api.cpp2
-rw-r--r--tests/auto/cmake/test_global_promotion/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_global_promotion/subdir_with_global_qt/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_global_promotion/subdir_with_local_qt/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_import_plugins/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_import_plugins/main.cpp2
-rw-r--r--tests/auto/cmake/test_interface/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_interface/main.cpp2
-rw-r--r--tests/auto/cmake/test_interface/mainwindow.cpp2
-rw-r--r--tests/auto/cmake/test_interface/mainwindow.h2
-rw-r--r--tests/auto/cmake/test_interface/widget_test/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_interface_link_libraries/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_interface_link_libraries/main.cpp2
-rw-r--r--tests/auto/cmake/test_interface_link_libraries/somelib.cpp2
-rw-r--r--tests/auto/cmake/test_interface_link_libraries/somelib.h2
-rw-r--r--tests/auto/cmake/test_json_plugin_includes/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_json_plugin_includes/plugin.cpp2
-rw-r--r--tests/auto/cmake/test_json_plugin_includes/plugin.h2
-rw-r--r--tests/auto/cmake/test_moc_macro_target/CMakeLists.txt32
-rw-r--r--tests/auto/cmake/test_moc_macro_target/check_moc_parameters.cmake15
-rw-r--r--tests/auto/cmake/test_moc_macro_target/interface/myinterface.h2
-rw-r--r--tests/auto/cmake/test_moc_macro_target/main_gen_test.cpp2
-rw-r--r--tests/auto/cmake/test_moc_macro_target/main_wrap_test.cpp2
-rw-r--r--tests/auto/cmake/test_moc_macro_target/mywrapobject.h2
-rw-r--r--tests/auto/cmake/test_multiple_find_package/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_multiple_find_package/main.cpp2
-rw-r--r--tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_opengl_lib/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_opengl_lib/main.cpp2
-rw-r--r--tests/auto/cmake/test_platform_defs_include/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_platform_defs_include/main.cpp2
-rw-r--r--tests/auto/cmake/test_plugin_shared_static_flavor.cmake3
-rw-r--r--tests/auto/cmake/test_plugin_shared_static_flavor/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_plugins/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_private_includes/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_private_includes/main.cpp2
-rw-r--r--tests/auto/cmake/test_private_targets/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_private_targets/main.cpp2
-rw-r--r--tests/auto/cmake/test_qt_add_resources_rebuild/CMakeLists.txt123
-rw-r--r--tests/auto/cmake/test_qt_add_resources_rebuild/sample/CMakeLists.txt45
-rw-r--r--tests/auto/cmake/test_qt_add_resources_rebuild/sample/input.ts1
-rw-r--r--tests/auto/cmake/test_qt_extract_metatypes/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/MetaType.cpp2
-rw-r--r--tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/main.cpp2
-rw-r--r--tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeEmpty.h2
-rw-r--r--tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeEmptyWithComment.h2
-rw-r--r--tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeQ_OBJECT.h2
-rw-r--r--tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeQ_OBJECTandQ_PROPERTY.h2
-rw-r--r--tests/auto/cmake/test_qt_manual_moc/CMakeLists.txt61
-rw-r--r--tests/auto/cmake/test_qt_manual_moc/VerifyDefines.cmake30
-rw-r--r--tests/auto/cmake/test_qt_manual_moc/testclass.cpp8
-rw-r--r--tests/auto/cmake/test_qt_manual_moc/testclass.h17
-rw-r--r--tests/auto/cmake/test_qt_manual_moc/testclass1.h17
-rw-r--r--tests/auto/cmake/test_qtmainwin_library/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_qtmainwin_library/myobject.cpp2
-rw-r--r--tests/auto/cmake/test_qtmainwin_library/myobject.h2
-rw-r--r--tests/auto/cmake/test_resource_without_obj_lib/CMakeLists.txt33
-rw-r--r--tests/auto/cmake/test_resource_without_obj_lib/helper_lib.cpp4
-rw-r--r--tests/auto/cmake/test_resource_without_obj_lib/main.cpp28
-rw-r--r--tests/auto/cmake/test_resource_without_obj_lib/resource.txt1
-rw-r--r--tests/auto/cmake/test_standalone_test/CMakeLists.txt14
-rw-r--r--tests/auto/cmake/test_standalone_test/tst_standalone_test.cpp22
-rw-r--r--tests/auto/cmake/test_static_resources/.cmake.conf2
-rw-r--r--tests/auto/cmake/test_static_resources/CMakeLists.txt5
-rw-r--r--tests/auto/cmake/test_static_resources/mock_static_resources1/CMakeLists.txt4
-rw-r--r--tests/auto/cmake/test_static_resources/mock_static_resources1/dummy.cpp2
-rw-r--r--tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/CMakeLists.txt4
-rw-r--r--tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/pluginmain.cpp2
-rw-r--r--tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/test_init_resources_static_plugin.cpp2
-rw-r--r--tests/auto/cmake/test_static_resources/test_static_resources_propagation/CMakeLists.txt11
-rw-r--r--tests/auto/cmake/test_static_resources/test_static_resources_propagation/main.cpp2
-rw-r--r--tests/auto/cmake/test_testlib_definitions/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_testlib_definitions/core_only/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_testlib_definitions/gui/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_testlib_definitions/main.cpp2
-rw-r--r--tests/auto/cmake/test_testlib_definitions/widgets/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_umbrella_config/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_umbrella_config/components_found/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_umbrella_config/components_not_found/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_versionless_targets/CMakeLists.txt106
-rw-r--r--tests/auto/cmake/test_versionless_targets/default/CMakeLists.txt17
-rw-r--r--tests/auto/cmake/test_versionless_targets/force_off/CMakeLists.txt18
-rw-r--r--tests/auto/cmake/test_versionless_targets/force_old/CMakeLists.txt21
-rw-r--r--tests/auto/cmake/test_versionless_targets/force_on/CMakeLists.txt20
-rw-r--r--tests/auto/cmake/test_widgets_app_deployment/CMakeLists.txt18
-rw-r--r--tests/auto/cmake/test_widgets_app_deployment/main.cpp2
-rw-r--r--tests/auto/cmake/test_wrap_cpp_and_resources/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_wrap_cpp_and_resources/myobject.cpp2
-rw-r--r--tests/auto/cmake/test_wrap_cpp_and_resources/myobject.h2
-rw-r--r--tests/auto/cmake/test_wrap_cpp_moc/CMakeLists.txt19
-rw-r--r--tests/auto/cmake/test_wrap_cpp_moc/main.cpp17
-rw-r--r--tests/auto/cmake/test_wrap_cpp_options/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_wrap_cpp_options/myobject.cpp2
-rw-r--r--tests/auto/cmake/test_wrap_cpp_options/myobject.h2
-rw-r--r--tests/auto/cmake/tst_qaddpreroutine/CMakeLists.txt4
-rw-r--r--tests/auto/cmake/tst_qaddpreroutine/plugin.cpp2
-rw-r--r--tests/auto/cmake/tst_qaddpreroutine/tst_qaddpreroutine.cpp2
187 files changed, 1601 insertions, 126 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 54ce69f0be..3331ad260d 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -1,4 +1,5 @@
-# special case skip regeneration
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
# This is an automatic test for the CMake configuration files.
# To run it manually,
@@ -43,6 +44,7 @@
cmake_minimum_required(VERSION 3.16)
project(cmake_usage_tests)
+include(GNUInstallDirs)
# Building the CMake tests as part of a Qt prefix build + in-tree tests, currently doesn't work.
# Each CMake test will fail with a message like
@@ -67,7 +69,8 @@ enable_testing()
# flag. Notably -rpath is specified which should implicitly enable -rpath-link, but that
# doesn't seem to be the case.
# Until this is figured out, disable the tests when cross-compiling to Linux.
-if(UNIX AND NOT APPLE AND NOT WIN32 AND CMAKE_CROSSCOMPILING AND NOT QT_ENABLE_CMAKE_BOOT2QT_TESTS)
+if(UNIX AND NOT APPLE AND NOT WIN32 AND CMAKE_CROSSCOMPILING AND NOT QT_ENABLE_CMAKE_BOOT2QT_TESTS
+ AND NOT QT_BUILD_MINIMAL_ANDROID_MULTI_ABI_TESTS)
message(STATUS "Running CMake tests is disabled when cross-compiling to Linux / Boot2Qt.")
return()
endif()
@@ -109,8 +112,63 @@ endif()
include("${_Qt6CTestMacros}")
+# Test only multi-abi specific functionality when QT_BUILD_MINIMAL_ANDROID_MULTI_ABI_TESTS is ON.
+# Qt::Gui is the prerequisite for all Android tests.
+if(QT_BUILD_MINIMAL_ANDROID_MULTI_ABI_TESTS AND NOT NO_GUI)
+ unset(multi_abi_vars)
+ foreach(abi IN LISTS QT_ANDROID_ABIS)
+ list(APPEND multi_abi_vars "-DQT_PATH_ANDROID_ABI_${abi}=${QT_PATH_ANDROID_ABI_${abi}}")
+ endforeach()
+ if(QT_ANDROID_BUILD_ALL_ABIS)
+ list(APPEND multi_abi_vars "-DQT_ANDROID_BUILD_ALL_ABIS=${QT_ANDROID_BUILD_ALL_ABIS}")
+ endif()
+
+ list(APPEND multi_abi_vars "-DQT_HOST_PATH=${QT_HOST_PATH}")
+
+ set(multi_abi_forward_vars
+ TEST_SINGLE_VALUE_ARG
+ TEST_SPACES_VALUE_ARG
+ TEST_LIST_VALUE_ARG
+ TEST_ESCAPING_VALUE_ARG
+ )
+ string(REPLACE ";" "[[;]]" multi_abi_forward_vars "${multi_abi_forward_vars}")
+
+ set(single_value "TestValue")
+ set(list_value "TestValue[[;]]TestValue2[[;]]TestValue3")
+ set(escaping_value "TestValue\\\\[[;]]TestValue2\\\\[[;]]TestValue3")
+ set(spaces_value "TestValue TestValue2 TestValue3")
+ _qt_internal_test_expect_pass(test_android_multi_abi_forward_vars
+ BUILD_OPTIONS
+ ${multi_abi_vars}
+ "-DQT_ANDROID_MULTI_ABI_FORWARD_VARS=${multi_abi_forward_vars}"
+ "-DTEST_SINGLE_VALUE_ARG=${single_value}"
+ "-DTEST_LIST_VALUE_ARG=${list_value}"
+ "-DTEST_ESCAPING_VALUE_ARG=${escaping_value}"
+ "-DTEST_SPACES_VALUE_ARG=${spaces_value}"
+ )
+ return()
+endif()
+
if(NOT NO_WIDGETS)
_qt_internal_test_expect_pass(test_build_simple_widget_app)
+ set(extra_widget_app_options "")
+ if(IOS)
+ list(APPEND extra_widget_app_options
+ QMAKE_OPTIONS CONFIG+=iossimulator
+ )
+ endif()
+ if(CMAKE_HOST_WIN32)
+ # Unset MAKEFLAGS environment variable when invoking build tool, it might
+ # have options incompatible with nmake.
+ list(APPEND extra_widget_app_options
+ BUILD_ENVIRONMENT MAKEFLAGS ""
+ )
+ endif()
+
+ _qt_internal_add_qmake_test(test_build_simple_widget_app
+ TESTNAME test_build_simple_widget_app_qmake
+ ${extra_widget_app_options}
+ )
endif()
# We only support a limited subset of cmake tests when targeting iOS:
@@ -124,14 +182,22 @@ if(IOS)
return()
endif()
+set(is_qt_build_platform TRUE)
+# macOS versions less than 10.15 are not supported for building Qt.
+if(CMAKE_HOST_APPLE AND CMAKE_HOST_SYSTEM_VERSION VERSION_LESS "19.0.0")
+ set(is_qt_build_platform FALSE)
+endif()
+
_qt_internal_test_expect_pass(test_umbrella_config)
_qt_internal_test_expect_pass(test_wrap_cpp_and_resources)
if (NOT NO_WIDGETS)
_qt_internal_test_expect_pass(test_dependent_modules)
_qt_internal_test_expect_pass("test(needsquoting)dirname")
endif()
+_qt_internal_test_expect_pass(test_add_resource_prefix BINARY test_add_resource_prefix)
_qt_internal_test_expect_build_fail(test_add_resource_options)
_qt_internal_test_expect_build_fail(test_wrap_cpp_options)
+_qt_internal_test_expect_pass(test_wrap_cpp_moc)
_qt_internal_test_expect_pass(test_platform_defs_include)
_qt_internal_test_expect_pass(test_qtmainwin_library)
@@ -156,6 +222,8 @@ endif()
_qt_internal_test_expect_pass(test_multiple_find_package)
_qt_internal_test_expect_pass(test_add_resources_delayed_file)
_qt_internal_test_expect_pass(test_add_binary_resources_delayed_file BINARY test_add_binary_resources_delayed_file)
+_qt_internal_test_expect_pass(test_qt_add_resources_rebuild)
+_qt_internal_test_expect_pass(test_resource_without_obj_lib BINARY test_resource_without_obj_lib)
if(NOT NO_GUI)
_qt_internal_test_expect_pass(test_private_includes)
@@ -167,13 +235,12 @@ _qt_internal_test_expect_pass(test_json_plugin_includes)
if(NOT NO_GUI)
_qt_internal_test_expect_build_fail(test_testlib_no_link_gui)
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy
+ "${CMAKE_CURRENT_SOURCE_DIR}/test_testlib_definitions/main.cpp"
+ "${CMAKE_CURRENT_BINARY_DIR}/failbuild/test_testlib_no_link_gui/test_testlib_no_link_gui/"
+ )
endif()
-execute_process(COMMAND ${CMAKE_COMMAND} -E copy
- "${CMAKE_CURRENT_SOURCE_DIR}/test_testlib_definitions/main.cpp"
- "${CMAKE_CURRENT_BINARY_DIR}/failbuild/test_testlib_no_link_gui/test_testlib_no_link_gui/"
-)
-
if (NOT NO_WIDGETS)
_qt_internal_test_expect_build_fail(test_testlib_no_link_widgets)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy
@@ -246,23 +313,37 @@ if(QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX)
elseif(QT6_INSTALL_PREFIX)
set(qt_install_prefix "${QT6_INSTALL_PREFIX}")
endif()
-if(INSTALL_BINDIR)
- set(qt_install_bin_dir "${INSTALL_BINDIR}")
-elseif(QT6_INSTALL_BINS)
- set(qt_install_bin_dir "${QT6_INSTALL_BINS}")
+
+if(INSTALL_LIBEXECDIR)
+ set(qt_install_libexec_dir "${INSTALL_LIBEXECDIR}")
+elseif(QT6_INSTALL_LIBEXECS)
+ set(qt_install_libexec_dir "${QT6_INSTALL_LIBEXECS}")
endif()
# Test building and installing a few dummy Qt modules and plugins.
-_qt_internal_test_expect_pass(mockplugins
- BINARY "${CMAKE_COMMAND}"
- BINARY_ARGS
- "-DQT_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}/mockplugins"
- -P "${qt_install_prefix}/${qt_install_bin_dir}/qt-cmake-private-install.cmake")
-set_tests_properties(mockplugins PROPERTIES FIXTURES_SETUP build_mockplugins)
+if(is_qt_build_platform)
+ set(mockplugins_test_args "")
+ if(NOT QT_FEATURE_no_prefix)
+ list(APPEND mockplugins_test_args
+ BINARY "${CMAKE_COMMAND}"
+ BINARY_ARGS
+ "-DQT_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}/mockplugins"
+ -P "${qt_install_prefix}/${qt_install_libexec_dir}/qt-cmake-private-install.cmake"
+ )
+ endif()
+ _qt_internal_test_expect_pass(mockplugins ${mockplugins_test_args})
+ set_tests_properties(mockplugins PROPERTIES FIXTURES_SETUP build_mockplugins)
-# Test importing the plugins built in the project above.
-_qt_internal_test_expect_pass(test_import_plugins BINARY ${CMAKE_CTEST_COMMAND} BINARY_ARGS -V)
-set_tests_properties(test_import_plugins PROPERTIES FIXTURES_REQUIRED build_mockplugins)
+ # Test importing the plugins built in the project above.
+ _qt_internal_test_expect_pass(test_import_plugins BINARY ${CMAKE_CTEST_COMMAND} BINARY_ARGS -V)
+ set_tests_properties(test_import_plugins PROPERTIES FIXTURES_REQUIRED build_mockplugins)
+endif()
+
+if(NOT NO_GUI)
+ _qt_internal_test_expect_pass(test_standalone_test
+ BINARY "${CMAKE_CTEST_COMMAND}"
+ BINARY_ARGS "-V")
+endif()
_qt_internal_test_expect_pass(test_versionless_targets)
@@ -272,16 +353,22 @@ endif()
_qt_internal_test_expect_pass(test_add_resources_binary_generated
BINARY test_add_resources_binary_generated)
+if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.17")
+ _qt_internal_test_expect_pass(test_add_resources_big_resources
+ BINARY test_add_resources_big_resources)
+endif()
include(test_plugin_shared_static_flavor.cmake)
_qt_internal_test_expect_pass(tst_qaddpreroutine
BINARY tst_qaddpreroutine)
-_qt_internal_test_expect_pass(test_static_resources
- BINARY "${CMAKE_CTEST_COMMAND}"
- BINARY_ARGS "-V")
+if(is_qt_build_platform)
+ _qt_internal_test_expect_pass(test_static_resources
+ BINARY "${CMAKE_CTEST_COMMAND}"
+ BINARY_ARGS "-V")
-_qt_internal_test_expect_pass(test_generating_cpp_exports)
+ _qt_internal_test_expect_pass(test_generating_cpp_exports)
+endif()
_qt_internal_test_expect_pass(test_qt_extract_metatypes)
@@ -292,14 +379,28 @@ set(deploy_args
# Need to explicitly specify a writable install prefix.
BUILD_OPTIONS
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/test_widgets_app_deployment_installed
+ NO_RUN_ENVIRONMENT_PLUGIN_PATH
)
-# For now, the test should only pass on Windows and macOS shared and static builds and fail on
-# other platforms, because there is no support for runtime dependency deployment
-# on those platforms.
+set(is_desktop_linux FALSE)
+if(UNIX AND NOT APPLE AND NOT ANDROID AND NOT CMAKE_CROSSCOMPILING)
+ set(is_desktop_linux TRUE)
+endif()
+
+# For now, the test should only pass on Windows, macOS and desktop Linux shared and static builds
+# and fail on other platforms, because there is no support for runtime dependency deployment on
+# those platforms.
# With static builds the runtime dependencies are just skipped, but the test should still pass.
-if((WIN32 OR (APPLE AND NOT IOS)))
+if(WIN32 OR (APPLE AND NOT IOS) OR is_desktop_linux)
_qt_internal_test_expect_pass(${deploy_args})
else()
_qt_internal_test_expect_fail(${deploy_args})
endif()
+
+_qt_internal_test_expect_pass(test_config_expressions)
+_qt_internal_test_expect_pass(test_QTP0003)
+if(NOT NO_GUI)
+ _qt_internal_test_expect_pass(test_collecting_plugins)
+endif()
+
+_qt_internal_test_expect_pass(test_qt_manual_moc)
diff --git a/tests/auto/cmake/mockplugins/.cmake.conf b/tests/auto/cmake/mockplugins/.cmake.conf
index 377be0059e..10bc1fd407 100644
--- a/tests/auto/cmake/mockplugins/.cmake.conf
+++ b/tests/auto/cmake/mockplugins/.cmake.conf
@@ -1 +1 @@
-set(QT_REPO_MODULE_VERSION "6.5.0")
+set(QT_REPO_MODULE_VERSION "6.8.0")
diff --git a/tests/auto/cmake/mockplugins/CMakeLists.txt b/tests/auto/cmake/mockplugins/CMakeLists.txt
index 7f61b562bc..1bde9aedb1 100644
--- a/tests/auto/cmake/mockplugins/CMakeLists.txt
+++ b/tests/auto/cmake/mockplugins/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from qtsvg.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
@@ -11,6 +12,8 @@ project(QtMockPlugins
)
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core)
+qt_internal_project_setup()
+
find_package(Qt6 ${PROJECT_VERSION} QUIET CONFIG OPTIONAL_COMPONENTS Gui Widgets Xml)
qt_build_repo_begin()
@@ -26,4 +29,5 @@ add_subdirectory(mock4plugin)
add_subdirectory(mock5plugin)
add_subdirectory(mock6plugin)
+qt_build_repo_post_process()
qt_build_repo_end()
diff --git a/tests/auto/cmake/mockplugins/mock1plugin/CMakeLists.txt b/tests/auto/cmake/mockplugins/mock1plugin/CMakeLists.txt
index 2af59e34eb..5a37ef9ea0 100644
--- a/tests/auto/cmake/mockplugins/mock1plugin/CMakeLists.txt
+++ b/tests/auto/cmake/mockplugins/mock1plugin/CMakeLists.txt
@@ -1,4 +1,8 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
qt_internal_add_plugin(QMock1Plugin
+ NO_UNITY_BUILD
CLASS_NAME QMock1Plugin
PLUGIN_TYPE mockplugin
SOURCES
diff --git a/tests/auto/cmake/mockplugins/mock1plugin/qmock1plugin.h b/tests/auto/cmake/mockplugins/mock1plugin/qmock1plugin.h
index 192b8c0591..324d0c38f4 100644
--- a/tests/auto/cmake/mockplugins/mock1plugin/qmock1plugin.h
+++ b/tests/auto/cmake/mockplugins/mock1plugin/qmock1plugin.h
@@ -1,5 +1,5 @@
// Copyright (C) 2018 Kitware, Inc.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef QMOCK1PLUGIN_H
#define QMOCK1PLUGIN_H
diff --git a/tests/auto/cmake/mockplugins/mock2plugin/CMakeLists.txt b/tests/auto/cmake/mockplugins/mock2plugin/CMakeLists.txt
index 275a57a1ac..f2705335f5 100644
--- a/tests/auto/cmake/mockplugins/mock2plugin/CMakeLists.txt
+++ b/tests/auto/cmake/mockplugins/mock2plugin/CMakeLists.txt
@@ -1,4 +1,8 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
qt_internal_add_plugin(QMock2Plugin
+ NO_UNITY_BUILD
CLASS_NAME QMock2Plugin
PLUGIN_TYPE mockplugin
SOURCES
diff --git a/tests/auto/cmake/mockplugins/mock2plugin/qmock2plugin.h b/tests/auto/cmake/mockplugins/mock2plugin/qmock2plugin.h
index 4d3765f28c..a1217ff4d6 100644
--- a/tests/auto/cmake/mockplugins/mock2plugin/qmock2plugin.h
+++ b/tests/auto/cmake/mockplugins/mock2plugin/qmock2plugin.h
@@ -1,5 +1,5 @@
// Copyright (C) 2018 Kitware, Inc.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef QMOCK2PLUGIN_H
#define QMOCK2PLUGIN_H
diff --git a/tests/auto/cmake/mockplugins/mock3plugin/CMakeLists.txt b/tests/auto/cmake/mockplugins/mock3plugin/CMakeLists.txt
index b87acd1d0e..b165353b24 100644
--- a/tests/auto/cmake/mockplugins/mock3plugin/CMakeLists.txt
+++ b/tests/auto/cmake/mockplugins/mock3plugin/CMakeLists.txt
@@ -1,4 +1,8 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
qt_internal_add_plugin(QMock3Plugin
+ NO_UNITY_BUILD
CLASS_NAME QMock3Plugin
PLUGIN_TYPE mockplugin
SOURCES
diff --git a/tests/auto/cmake/mockplugins/mock3plugin/qmock3plugin.h b/tests/auto/cmake/mockplugins/mock3plugin/qmock3plugin.h
index 8143c06c43..3e152784e0 100644
--- a/tests/auto/cmake/mockplugins/mock3plugin/qmock3plugin.h
+++ b/tests/auto/cmake/mockplugins/mock3plugin/qmock3plugin.h
@@ -1,5 +1,5 @@
// Copyright (C) 2018 Kitware, Inc.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef QMOCK3PLUGIN_H
#define QMOCK3PLUGIN_H
diff --git a/tests/auto/cmake/mockplugins/mock4plugin/CMakeLists.txt b/tests/auto/cmake/mockplugins/mock4plugin/CMakeLists.txt
index f13ec00332..cf09fb294b 100644
--- a/tests/auto/cmake/mockplugins/mock4plugin/CMakeLists.txt
+++ b/tests/auto/cmake/mockplugins/mock4plugin/CMakeLists.txt
@@ -1,4 +1,8 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
qt_internal_add_plugin(QMock4Plugin
+ NO_UNITY_BUILD
CLASS_NAME QMock4Plugin
PLUGIN_TYPE mockplugin
DEFAULT_IF FALSE
diff --git a/tests/auto/cmake/mockplugins/mock4plugin/qmock4plugin.h b/tests/auto/cmake/mockplugins/mock4plugin/qmock4plugin.h
index 3aad9a6cae..1895367575 100644
--- a/tests/auto/cmake/mockplugins/mock4plugin/qmock4plugin.h
+++ b/tests/auto/cmake/mockplugins/mock4plugin/qmock4plugin.h
@@ -1,5 +1,5 @@
// Copyright (C) 2018 Kitware, Inc.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef QMOCK4PLUGIN_H
#define QMOCK4PLUGIN_H
diff --git a/tests/auto/cmake/mockplugins/mock5plugin/CMakeLists.txt b/tests/auto/cmake/mockplugins/mock5plugin/CMakeLists.txt
index d3fa0e428a..1d34cabe1f 100644
--- a/tests/auto/cmake/mockplugins/mock5plugin/CMakeLists.txt
+++ b/tests/auto/cmake/mockplugins/mock5plugin/CMakeLists.txt
@@ -1,4 +1,8 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
qt_internal_add_plugin(QMock5Plugin
+ NO_UNITY_BUILD
CLASS_NAME QMock5Plugin
PLUGIN_TYPE mockplugin
DEFAULT_IF FALSE
diff --git a/tests/auto/cmake/mockplugins/mock5plugin/qmock5plugin.h b/tests/auto/cmake/mockplugins/mock5plugin/qmock5plugin.h
index 5f2c9eeeb9..4b6c95fb23 100644
--- a/tests/auto/cmake/mockplugins/mock5plugin/qmock5plugin.h
+++ b/tests/auto/cmake/mockplugins/mock5plugin/qmock5plugin.h
@@ -1,5 +1,5 @@
// Copyright (C) 2018 Kitware, Inc.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef QMOCK5PLUGIN_H
#define QMOCK5PLUGIN_H
diff --git a/tests/auto/cmake/mockplugins/mock6plugin/CMakeLists.txt b/tests/auto/cmake/mockplugins/mock6plugin/CMakeLists.txt
index 0311214dde..5d80407d57 100644
--- a/tests/auto/cmake/mockplugins/mock6plugin/CMakeLists.txt
+++ b/tests/auto/cmake/mockplugins/mock6plugin/CMakeLists.txt
@@ -1,4 +1,8 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
qt_internal_add_plugin(QMock6Plugin
+ NO_UNITY_BUILD
CLASS_NAME QMock6Plugin
PLUGIN_TYPE mockauxplugin
SOURCES
diff --git a/tests/auto/cmake/mockplugins/mock6plugin/qmock6plugin.h b/tests/auto/cmake/mockplugins/mock6plugin/qmock6plugin.h
index e2a3eb10c5..5278d67960 100644
--- a/tests/auto/cmake/mockplugins/mock6plugin/qmock6plugin.h
+++ b/tests/auto/cmake/mockplugins/mock6plugin/qmock6plugin.h
@@ -1,5 +1,5 @@
// Copyright (C) 2018 Kitware, Inc.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef QMOCK6PLUGIN_H
#define QMOCK6PLUGIN_H
diff --git a/tests/auto/cmake/mockplugins/mockplugins1/CMakeLists.txt b/tests/auto/cmake/mockplugins/mockplugins1/CMakeLists.txt
index 705885c7fa..adba60e42d 100644
--- a/tests/auto/cmake/mockplugins/mockplugins1/CMakeLists.txt
+++ b/tests/auto/cmake/mockplugins/mockplugins1/CMakeLists.txt
@@ -1,6 +1,11 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
qt_internal_add_module(MockPlugins1
+ NO_UNITY_BUILD
PLUGIN_TYPES mockplugin
SOURCES
+ qmockplugin.h
fake.cpp
LIBRARIES
Qt::CorePrivate
diff --git a/tests/auto/cmake/mockplugins/mockplugins1/fake.cpp b/tests/auto/cmake/mockplugins/mockplugins1/fake.cpp
index f71e2748a2..6cdf6a09ce 100644
--- a/tests/auto/cmake/mockplugins/mockplugins1/fake.cpp
+++ b/tests/auto/cmake/mockplugins/mockplugins1/fake.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2019 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtCore/QtGlobal>
diff --git a/tests/auto/cmake/mockplugins/mockplugins1/qmockplugin.h b/tests/auto/cmake/mockplugins/mockplugins1/qmockplugin.h
index ee9db067c5..d4dcea5c20 100644
--- a/tests/auto/cmake/mockplugins/mockplugins1/qmockplugin.h
+++ b/tests/auto/cmake/mockplugins/mockplugins1/qmockplugin.h
@@ -1,11 +1,11 @@
// Copyright (C) 2018 Kitware, Inc.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef QMOCKPLUGIN_H
#define QMOCKPLUGIN_H
-#include <QString>
-#include <QtPlugin>
+#include <QtCore/QString>
+#include <QtCore/QtPlugin>
QT_BEGIN_NAMESPACE
diff --git a/tests/auto/cmake/mockplugins/mockplugins2/CMakeLists.txt b/tests/auto/cmake/mockplugins/mockplugins2/CMakeLists.txt
index 9d406ef483..a797206cd6 100644
--- a/tests/auto/cmake/mockplugins/mockplugins2/CMakeLists.txt
+++ b/tests/auto/cmake/mockplugins/mockplugins2/CMakeLists.txt
@@ -1,4 +1,8 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
qt_internal_add_module(MockPlugins2
+ NO_UNITY_BUILD
SOURCES
fake.cpp
LIBRARIES
diff --git a/tests/auto/cmake/mockplugins/mockplugins2/fake.cpp b/tests/auto/cmake/mockplugins/mockplugins2/fake.cpp
index 2ad5f6144a..9256ef181f 100644
--- a/tests/auto/cmake/mockplugins/mockplugins2/fake.cpp
+++ b/tests/auto/cmake/mockplugins/mockplugins2/fake.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2019 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtCore/QtGlobal>
diff --git a/tests/auto/cmake/mockplugins/mockplugins3/CMakeLists.txt b/tests/auto/cmake/mockplugins/mockplugins3/CMakeLists.txt
index fc7c7aa944..b8e3c54535 100644
--- a/tests/auto/cmake/mockplugins/mockplugins3/CMakeLists.txt
+++ b/tests/auto/cmake/mockplugins/mockplugins3/CMakeLists.txt
@@ -1,6 +1,11 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
qt_internal_add_module(MockPlugins3
+ NO_UNITY_BUILD
PLUGIN_TYPES mockauxplugin
SOURCES
+ qmockauxplugin.h
fake.cpp
LIBRARIES
Qt::CorePrivate
diff --git a/tests/auto/cmake/mockplugins/mockplugins3/fake.cpp b/tests/auto/cmake/mockplugins/mockplugins3/fake.cpp
index 5a3c187143..9ca82b9ef7 100644
--- a/tests/auto/cmake/mockplugins/mockplugins3/fake.cpp
+++ b/tests/auto/cmake/mockplugins/mockplugins3/fake.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2019 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtCore/QtGlobal>
diff --git a/tests/auto/cmake/mockplugins/mockplugins3/qmockauxplugin.h b/tests/auto/cmake/mockplugins/mockplugins3/qmockauxplugin.h
index 80dcddf993..599c3ecbb4 100644
--- a/tests/auto/cmake/mockplugins/mockplugins3/qmockauxplugin.h
+++ b/tests/auto/cmake/mockplugins/mockplugins3/qmockauxplugin.h
@@ -1,11 +1,11 @@
// Copyright (C) 2018 Kitware, Inc.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef QMOCKAUXPLUGIN_H
#define QMOCKAUXPLUGIN_H
-#include <QString>
-#include <QtPlugin>
+#include <QtCore/QString>
+#include <QtCore/QtPlugin>
QT_BEGIN_NAMESPACE
diff --git a/tests/auto/cmake/test(needsquoting)dirname/CMakeLists.txt b/tests/auto/cmake/test(needsquoting)dirname/CMakeLists.txt
index c2a575af65..1916c048d3 100644
--- a/tests/auto/cmake/test(needsquoting)dirname/CMakeLists.txt
+++ b/tests/auto/cmake/test(needsquoting)dirname/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test(needsquoting)dirname/mywidget.cpp b/tests/auto/cmake/test(needsquoting)dirname/mywidget.cpp
index c0e3870c91..da7f51d286 100644
--- a/tests/auto/cmake/test(needsquoting)dirname/mywidget.cpp
+++ b/tests/auto/cmake/test(needsquoting)dirname/mywidget.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "mywidget.h"
#include "ui_mywidget.h"
diff --git a/tests/auto/cmake/test(needsquoting)dirname/mywidget.h b/tests/auto/cmake/test(needsquoting)dirname/mywidget.h
index 8b8e2ee350..4517670b56 100644
--- a/tests/auto/cmake/test(needsquoting)dirname/mywidget.h
+++ b/tests/auto/cmake/test(needsquoting)dirname/mywidget.h
@@ -1,5 +1,5 @@
// Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef MYWIDGET_H
#define MYWIDGET_H
diff --git a/tests/auto/cmake/test_QFINDTESTDATA/CMakeLists.txt b/tests/auto/cmake/test_QFINDTESTDATA/CMakeLists.txt
index b67ff560e4..12ac9c9d6a 100644
--- a/tests/auto/cmake/test_QFINDTESTDATA/CMakeLists.txt
+++ b/tests/auto/cmake/test_QFINDTESTDATA/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_QFINDTESTDATA/tests/CMakeLists.txt b/tests/auto/cmake/test_QFINDTESTDATA/tests/CMakeLists.txt
index df91a7d84b..6d49ab8c3b 100644
--- a/tests/auto/cmake/test_QFINDTESTDATA/tests/CMakeLists.txt
+++ b/tests/auto/cmake/test_QFINDTESTDATA/tests/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
add_executable(test_QFINDTESTDATA WIN32 main.cpp)
diff --git a/tests/auto/cmake/test_QFINDTESTDATA/tests/main.cpp b/tests/auto/cmake/test_QFINDTESTDATA/tests/main.cpp
index 52732df425..7938bbb863 100644
--- a/tests/auto/cmake/test_QFINDTESTDATA/tests/main.cpp
+++ b/tests/auto/cmake/test_QFINDTESTDATA/tests/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2016 Stephen Kelly <steveire@gmail,com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QCoreApplication>
#include <QtTest/QTest>
diff --git a/tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt b/tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt
index a256cfc067..535af3d4b5 100644
--- a/tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt
+++ b/tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
if(POLICY CMP0099)
cmake_policy(SET CMP0099 NEW) # Avoid CMP0099 related warnings.
diff --git a/tests/auto/cmake/test_QTBUG-63422/mywidget.cpp b/tests/auto/cmake/test_QTBUG-63422/mywidget.cpp
index 0657edf2b2..adbfcd35e8 100644
--- a/tests/auto/cmake/test_QTBUG-63422/mywidget.cpp
+++ b/tests/auto/cmake/test_QTBUG-63422/mywidget.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Kevin Funk <kevin.funk@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "mywidget.h"
#include "ui_mywidget.h"
diff --git a/tests/auto/cmake/test_QTBUG-63422/mywidget.h b/tests/auto/cmake/test_QTBUG-63422/mywidget.h
index 203a3876ed..f975ae2fa3 100644
--- a/tests/auto/cmake/test_QTBUG-63422/mywidget.h
+++ b/tests/auto/cmake/test_QTBUG-63422/mywidget.h
@@ -1,5 +1,5 @@
// Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Kevin Funk <kevin.funk@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef MYWIDGET_H
#define MYWIDGET_H
diff --git a/tests/auto/cmake/test_QTP0003/CMakeLists.txt b/tests/auto/cmake/test_QTP0003/CMakeLists.txt
new file mode 100644
index 0000000000..8dda76fdb0
--- /dev/null
+++ b/tests/auto/cmake/test_QTP0003/CMakeLists.txt
@@ -0,0 +1,66 @@
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+
+project(test_QTP0003)
+
+find_package(Qt6 COMPONENTS Core REQUIRED)
+
+if(QT6_IS_SHARED_LIBS_BUILD)
+ set(qt_build_type "SHARED_LIBRARY")
+else()
+ set(qt_build_type "STATIC_LIBRARY")
+endif()
+
+set(BUILD_SHARED_LIBS ON)
+qt6_add_library(MyLib source.cpp)
+get_target_property(type MyLib TYPE)
+if(NOT "${type}" STREQUAL "${qt_build_type}")
+ message(FATAL_ERROR "The library uses the default type different from Qt build type when"
+ "QTP0003 is not set")
+endif()
+
+set(BUILD_SHARED_LIBS OFF)
+qt6_add_library(MyLib2 source.cpp)
+get_target_property(type MyLib2 TYPE)
+if(NOT "${type}" STREQUAL "${qt_build_type}")
+ message(FATAL_ERROR "The library uses the default type different from Qt build type when"
+ "QTP0003 is not set")
+endif()
+
+set(BUILD_SHARED_LIBS ON)
+qt_policy(SET QTP0003 OLD)
+qt6_add_library(MyLib3 source.cpp)
+get_target_property(type MyLib3 TYPE)
+if(NOT "${type}" STREQUAL "${qt_build_type}")
+ message(FATAL_ERROR "The library uses the default type different from Qt build type when"
+ "QTP0003 is set to OLD")
+endif()
+
+set(BUILD_SHARED_LIBS OFF)
+qt_policy(SET QTP0003 OLD)
+qt6_add_library(MyLib4 source.cpp)
+get_target_property(type MyLib4 TYPE)
+if(NOT "${type}" STREQUAL "${qt_build_type}")
+ message(FATAL_ERROR "The library uses the default type different from Qt build type when"
+ "QTP0003 is set to OLD")
+endif()
+
+set(BUILD_SHARED_LIBS ON)
+qt_policy(SET QTP0003 NEW)
+qt6_add_library(MyLib5 source.cpp)
+get_target_property(type MyLib5 TYPE)
+if(NOT "${type}" STREQUAL "SHARED_LIBRARY")
+ message(FATAL_ERROR "The library doesn't consider the BUILD_SHARED_LIBS when"
+ "QTP0003 is set to NEW")
+endif()
+
+set(BUILD_SHARED_LIBS OFF)
+qt_policy(SET QTP0003 NEW)
+qt6_add_library(MyLib6 source.cpp)
+get_target_property(type MyLib6 TYPE)
+if(NOT "${type}" STREQUAL "STATIC_LIBRARY")
+ message(FATAL_ERROR "The library doesn't consider the BUILD_SHARED_LIBS when"
+ "QTP0003 is set to NEW")
+endif()
diff --git a/tests/auto/cmake/test_QTP0003/source.cpp b/tests/auto/cmake/test_QTP0003/source.cpp
new file mode 100644
index 0000000000..273d7dade4
--- /dev/null
+++ b/tests/auto/cmake/test_QTP0003/source.cpp
@@ -0,0 +1,4 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+class Noop {};
diff --git a/tests/auto/cmake/test_QT_TESTCASE_BUILDDIR/CMakeLists.txt b/tests/auto/cmake/test_QT_TESTCASE_BUILDDIR/CMakeLists.txt
index 92ce28a5b9..6e2a7d57bf 100644
--- a/tests/auto/cmake/test_QT_TESTCASE_BUILDDIR/CMakeLists.txt
+++ b/tests/auto/cmake/test_QT_TESTCASE_BUILDDIR/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
# The test is simply testing that manual specification of QT_TESTCASE_BUILDDIR works,
# despite the weird paths.
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_QT_TESTCASE_BUILDDIR/main.cpp b/tests/auto/cmake/test_QT_TESTCASE_BUILDDIR/main.cpp
index 7911bf74e7..ae34d13ff1 100644
--- a/tests/auto/cmake/test_QT_TESTCASE_BUILDDIR/main.cpp
+++ b/tests/auto/cmake/test_QT_TESTCASE_BUILDDIR/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QCoreApplication>
#include <QtTest/QTest>
diff --git a/tests/auto/cmake/test_add_big_resource/CMakeLists.txt b/tests/auto/cmake/test_add_big_resource/CMakeLists.txt
index b712f5a23d..bee8472475 100644
--- a/tests/auto/cmake/test_add_big_resource/CMakeLists.txt
+++ b/tests/auto/cmake/test_add_big_resource/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(test_add_big_resource)
diff --git a/tests/auto/cmake/test_add_big_resource/myobject.cpp b/tests/auto/cmake/test_add_big_resource/myobject.cpp
index 12434f4689..34c2ccc6bf 100644
--- a/tests/auto/cmake/test_add_big_resource/myobject.cpp
+++ b/tests/auto/cmake/test_add_big_resource/myobject.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "myobject.h"
diff --git a/tests/auto/cmake/test_add_big_resource/myobject.h b/tests/auto/cmake/test_add_big_resource/myobject.h
index 917ae9fd24..87d7bfa3df 100644
--- a/tests/auto/cmake/test_add_big_resource/myobject.h
+++ b/tests/auto/cmake/test_add_big_resource/myobject.h
@@ -1,5 +1,5 @@
// Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef MYOBJECT_H
#define MYOBJECT_H
diff --git a/tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt b/tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt
index 1ca2c0940a..9a247bc684 100644
--- a/tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt
+++ b/tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_add_binary_resources_delayed_file/main.cpp b/tests/auto/cmake/test_add_binary_resources_delayed_file/main.cpp
index b8b6ec7717..f0bc74403c 100644
--- a/tests/auto/cmake/test_add_binary_resources_delayed_file/main.cpp
+++ b/tests/auto/cmake/test_add_binary_resources_delayed_file/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2015 André Klitzing <aklitzing@gmail.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QFile>
#include <QResource>
diff --git a/tests/auto/cmake/test_add_resource_options/CMakeLists.txt b/tests/auto/cmake/test_add_resource_options/CMakeLists.txt
index 4692cdbdc6..d7bb053714 100644
--- a/tests/auto/cmake/test_add_resource_options/CMakeLists.txt
+++ b/tests/auto/cmake/test_add_resource_options/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_add_resource_options/myobject.cpp b/tests/auto/cmake/test_add_resource_options/myobject.cpp
index 2a90499e6a..14e00e789a 100644
--- a/tests/auto/cmake/test_add_resource_options/myobject.cpp
+++ b/tests/auto/cmake/test_add_resource_options/myobject.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "myobject.h"
diff --git a/tests/auto/cmake/test_add_resource_options/myobject.h b/tests/auto/cmake/test_add_resource_options/myobject.h
index 917ae9fd24..87d7bfa3df 100644
--- a/tests/auto/cmake/test_add_resource_options/myobject.h
+++ b/tests/auto/cmake/test_add_resource_options/myobject.h
@@ -1,5 +1,5 @@
// Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef MYOBJECT_H
#define MYOBJECT_H
diff --git a/tests/auto/cmake/test_add_resource_prefix/CMakeLists.txt b/tests/auto/cmake/test_add_resource_prefix/CMakeLists.txt
new file mode 100644
index 0000000000..65faa4cb09
--- /dev/null
+++ b/tests/auto/cmake/test_add_resource_prefix/CMakeLists.txt
@@ -0,0 +1,25 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+
+project(test_add_resource_prefix)
+
+find_package(Qt6 REQUIRED
+ COMPONENTS Core Test
+)
+
+set(CMAKE_AUTOMOC ON)
+
+add_executable(test_add_resource_prefix main.cpp)
+
+# Tests if "/" is being used when PREFIX is missing
+qt_add_resources(test_add_resource_prefix "resources_without_prefix"
+ FILES resource_file.txt)
+
+# Tests if the PREFIX parameter is being respected
+qt_add_resources(test_add_resource_prefix "resources_with_prefix"
+ PREFIX "/resources"
+ FILES resource_file.txt)
+
+target_link_libraries(test_add_resource_prefix PRIVATE Qt::Core Qt::Test)
diff --git a/tests/auto/cmake/test_add_resource_prefix/main.cpp b/tests/auto/cmake/test_add_resource_prefix/main.cpp
new file mode 100644
index 0000000000..1a8b37715b
--- /dev/null
+++ b/tests/auto/cmake/test_add_resource_prefix/main.cpp
@@ -0,0 +1,26 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include <QFile>
+#include <QtTest>
+
+class TestAddResourcePrefix : public QObject
+{
+ Q_OBJECT
+private slots:
+ void resourceInDefaultPathExists();
+ void resourceInGivenPathExists();
+};
+
+void TestAddResourcePrefix::resourceInDefaultPathExists()
+{
+ QVERIFY(QFile::exists(":/resource_file.txt"));
+}
+
+void TestAddResourcePrefix::resourceInGivenPathExists()
+{
+ QVERIFY(QFile::exists(":/resources/resource_file.txt"));
+}
+
+QTEST_MAIN(TestAddResourcePrefix)
+#include "main.moc"
diff --git a/tests/auto/cmake/test_add_resource_prefix/resource_file.txt b/tests/auto/cmake/test_add_resource_prefix/resource_file.txt
new file mode 100644
index 0000000000..2c604a4f18
--- /dev/null
+++ b/tests/auto/cmake/test_add_resource_prefix/resource_file.txt
@@ -0,0 +1 @@
+Ken sent me.
diff --git a/tests/auto/cmake/test_add_resources_big_resources/CMakeLists.txt b/tests/auto/cmake/test_add_resources_big_resources/CMakeLists.txt
new file mode 100644
index 0000000000..9f9ae6a43c
--- /dev/null
+++ b/tests/auto/cmake/test_add_resources_big_resources/CMakeLists.txt
@@ -0,0 +1,45 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+
+project(test_add_resources_big_resources)
+
+if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/FindPackageHints.cmake")
+ include("${CMAKE_CURRENT_LIST_DIR}/FindPackageHints.cmake")
+endif()
+
+find_package(Qt6 REQUIRED
+ COMPONENTS Core Test
+ HINTS ${Qt6Tests_PREFIX_PATH}
+)
+
+qt6_add_library(leaf_lib STATIC leaf_lib.cpp)
+qt6_add_resources(leaf_lib resources2
+ FILES resource2.txt PREFIX "/" BIG_RESOURCES)
+target_link_libraries(leaf_lib PRIVATE Qt6::Core)
+
+if(NOT TARGET leaf_lib_resources2_obj)
+ message(FATAL_ERROR "Object library for resources2 was not created.")
+endif()
+
+qt6_add_library(intermediate_lib STATIC intermediate_lib.cpp)
+qt6_add_resources(intermediate_lib resources3
+ FILES resource3.txt PREFIX "/" BIG_RESOURCES
+)
+target_link_libraries(intermediate_lib PRIVATE Qt6::Core leaf_lib)
+
+if(NOT TARGET intermediate_lib_resources3_obj)
+ message(FATAL_ERROR "Object library for resources3 was not created.")
+endif()
+
+set(CMAKE_AUTOMOC ON)
+
+qt6_add_executable(test_add_resources_big_resources main.cpp)
+qt6_add_resources(test_add_resources_big_resources resources1
+ FILES resource1.txt PREFIX "/" BIG_RESOURCES)
+target_link_libraries(test_add_resources_big_resources PRIVATE Qt6::Test intermediate_lib)
+
+if(NOT TARGET test_add_resources_big_resources_resources1_obj)
+ message(FATAL_ERROR "Object library for resources1 was not created.")
+endif()
diff --git a/tests/auto/cmake/test_add_resources_big_resources/intermediate_lib.cpp b/tests/auto/cmake/test_add_resources_big_resources/intermediate_lib.cpp
new file mode 100644
index 0000000000..a8f2be6955
--- /dev/null
+++ b/tests/auto/cmake/test_add_resources_big_resources/intermediate_lib.cpp
@@ -0,0 +1,20 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include "leaf_lib.h"
+
+#include <QtCore/qfile.h>
+
+namespace intermediate_lib {
+
+bool isLeafLibResourceAvailable()
+{
+ return leaf_lib::isResourceAvailable();
+}
+
+bool isResourceAvailable()
+{
+ return QFile::exists(u":/resource3.txt"_qs);
+}
+
+} // namespace
diff --git a/tests/auto/cmake/test_add_resources_big_resources/intermediate_lib.h b/tests/auto/cmake/test_add_resources_big_resources/intermediate_lib.h
new file mode 100644
index 0000000000..efa03e8a5e
--- /dev/null
+++ b/tests/auto/cmake/test_add_resources_big_resources/intermediate_lib.h
@@ -0,0 +1,9 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#pragma once
+
+namespace intermediate_lib {
+bool isLeafLibResourceAvailable();
+bool isResourceAvailable();
+} //namespace
diff --git a/tests/auto/cmake/test_add_resources_big_resources/leaf_lib.cpp b/tests/auto/cmake/test_add_resources_big_resources/leaf_lib.cpp
new file mode 100644
index 0000000000..8363ceec0a
--- /dev/null
+++ b/tests/auto/cmake/test_add_resources_big_resources/leaf_lib.cpp
@@ -0,0 +1,13 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include <QtCore/qfile.h>
+
+namespace leaf_lib {
+
+bool isResourceAvailable()
+{
+ return QFile::exists(u":/resource2.txt"_qs);
+}
+
+} // namespace
diff --git a/tests/auto/cmake/test_add_resources_big_resources/leaf_lib.h b/tests/auto/cmake/test_add_resources_big_resources/leaf_lib.h
new file mode 100644
index 0000000000..71195a7c74
--- /dev/null
+++ b/tests/auto/cmake/test_add_resources_big_resources/leaf_lib.h
@@ -0,0 +1,8 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#pragma once
+
+namespace leaf_lib {
+bool isResourceAvailable();
+} // namespace
diff --git a/tests/auto/cmake/test_add_resources_big_resources/main.cpp b/tests/auto/cmake/test_add_resources_big_resources/main.cpp
new file mode 100644
index 0000000000..8ff0c4f54c
--- /dev/null
+++ b/tests/auto/cmake/test_add_resources_big_resources/main.cpp
@@ -0,0 +1,35 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include "intermediate_lib.h"
+
+#include <QtCore/qfile.h>
+#include <QtTest/QtTest>
+
+class TestAddResourcesBigResources : public QObject
+{
+ Q_OBJECT
+private slots:
+ void resourceInApplicationExists();
+ void resourceInIntermediateLibExists();
+ void resourceInLeafLibExists();
+};
+
+void TestAddResourcesBigResources::resourceInApplicationExists()
+{
+ QVERIFY(QFile::exists(":/resource1.txt"));
+}
+
+void TestAddResourcesBigResources::resourceInIntermediateLibExists()
+{
+ QVERIFY(intermediate_lib::isResourceAvailable());
+}
+
+void TestAddResourcesBigResources::resourceInLeafLibExists()
+{
+ QVERIFY(intermediate_lib::isLeafLibResourceAvailable());
+}
+
+QTEST_MAIN(TestAddResourcesBigResources)
+#include "main.moc"
+
diff --git a/tests/auto/cmake/test_add_resources_big_resources/resource1.txt b/tests/auto/cmake/test_add_resources_big_resources/resource1.txt
new file mode 100644
index 0000000000..bc06a6d721
--- /dev/null
+++ b/tests/auto/cmake/test_add_resources_big_resources/resource1.txt
@@ -0,0 +1 @@
+Test resource1
diff --git a/tests/auto/cmake/test_add_resources_big_resources/resource2.txt b/tests/auto/cmake/test_add_resources_big_resources/resource2.txt
new file mode 100644
index 0000000000..b8f9e67458
--- /dev/null
+++ b/tests/auto/cmake/test_add_resources_big_resources/resource2.txt
@@ -0,0 +1 @@
+Test resource2
diff --git a/tests/auto/cmake/test_add_resources_big_resources/resource3.txt b/tests/auto/cmake/test_add_resources_big_resources/resource3.txt
new file mode 100644
index 0000000000..0ed6318a85
--- /dev/null
+++ b/tests/auto/cmake/test_add_resources_big_resources/resource3.txt
@@ -0,0 +1 @@
+Test resource3
diff --git a/tests/auto/cmake/test_add_resources_binary_generated/CMakeLists.txt b/tests/auto/cmake/test_add_resources_binary_generated/CMakeLists.txt
index 2d5a399a0c..df9ef0c3bb 100644
--- a/tests/auto/cmake/test_add_resources_binary_generated/CMakeLists.txt
+++ b/tests/auto/cmake/test_add_resources_binary_generated/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(test_add_resources_binary_generated)
diff --git a/tests/auto/cmake/test_add_resources_binary_generated/main.cpp b/tests/auto/cmake/test_add_resources_binary_generated/main.cpp
index 906232ca19..73177555d4 100644
--- a/tests/auto/cmake/test_add_resources_binary_generated/main.cpp
+++ b/tests/auto/cmake/test_add_resources_binary_generated/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2020 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QFile>
#include <QResource>
diff --git a/tests/auto/cmake/test_add_resources_delayed_file/CMakeLists.txt b/tests/auto/cmake/test_add_resources_delayed_file/CMakeLists.txt
index 49bc5cbb2b..1a320dadf0 100644
--- a/tests/auto/cmake/test_add_resources_delayed_file/CMakeLists.txt
+++ b/tests/auto/cmake/test_add_resources_delayed_file/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_add_resources_delayed_file/main.cpp b/tests/auto/cmake/test_add_resources_delayed_file/main.cpp
index 9f722faff4..1a1596dd6a 100644
--- a/tests/auto/cmake/test_add_resources_delayed_file/main.cpp
+++ b/tests/auto/cmake/test_add_resources_delayed_file/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qglobal.h>
diff --git a/tests/auto/cmake/test_android_multi_abi_forward_vars/CMakeLists.txt b/tests/auto/cmake/test_android_multi_abi_forward_vars/CMakeLists.txt
new file mode 100644
index 0000000000..0f84d5ff3e
--- /dev/null
+++ b/tests/auto/cmake/test_android_multi_abi_forward_vars/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+
+project(test_android_multi_abi_forward_vars)
+
+find_package(Qt6 COMPONENTS Core Gui REQUIRED)
+
+if(NOT TEST_SINGLE_VALUE_ARG STREQUAL "TestValue")
+ message(FATAL_ERROR
+ "TEST_SINGLE_VALUE_ARG is not valid: ${TEST_SINGLE_VALUE_ARG}")
+endif()
+
+if(NOT TEST_LIST_VALUE_ARG STREQUAL "TestValue;TestValue2;TestValue3")
+ message(FATAL_ERROR
+ "TEST_LIST_VALUE_ARG is not valid: ${TEST_LIST_VALUE_ARG}")
+endif()
+
+if(NOT TEST_ESCAPING_VALUE_ARG STREQUAL "TestValue\;TestValue2\;TestValue3")
+ message(FATAL_ERROR
+ "TEST_ESCAPING_VALUE_ARG is not valid: ${TEST_ESCAPING_VALUE_ARG}")
+endif()
+
+if(NOT TEST_SPACES_VALUE_ARG STREQUAL "TestValue TestValue2 TestValue3")
+ message(FATAL_ERROR
+ "TEST_SPACES_VALUE_ARG is not valid: ${TEST_SPACES_VALUE_ARG}")
+endif()
+
+# Make sure that ABI external projects are created
+qt6_add_executable(test_executable main.cpp)
+
+target_link_libraries(test_executable PRIVATE Qt::Core Qt::Gui)
diff --git a/tests/auto/cmake/test_android_multi_abi_forward_vars/main.cpp b/tests/auto/cmake/test_android_multi_abi_forward_vars/main.cpp
new file mode 100644
index 0000000000..304c7b20dc
--- /dev/null
+++ b/tests/auto/cmake/test_android_multi_abi_forward_vars/main.cpp
@@ -0,0 +1,4 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+int main(int, char *[]) { return 0; }
diff --git a/tests/auto/cmake/test_build_simple_widget_app/CMakeLists.txt b/tests/auto/cmake/test_build_simple_widget_app/CMakeLists.txt
index daccf5bb80..1fcd026cce 100644
--- a/tests/auto/cmake/test_build_simple_widget_app/CMakeLists.txt
+++ b/tests/auto/cmake/test_build_simple_widget_app/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(ios_projects LANGUAGES CXX)
diff --git a/tests/auto/cmake/test_build_simple_widget_app/main.cpp b/tests/auto/cmake/test_build_simple_widget_app/main.cpp
index 734c72a263..b4502fa05a 100644
--- a/tests/auto/cmake/test_build_simple_widget_app/main.cpp
+++ b/tests/auto/cmake/test_build_simple_widget_app/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QApplication>
#include <QWidget>
diff --git a/tests/auto/cmake/test_build_simple_widget_app/test_build_simple_widget_app.pro b/tests/auto/cmake/test_build_simple_widget_app/test_build_simple_widget_app.pro
new file mode 100644
index 0000000000..30834e2ee2
--- /dev/null
+++ b/tests/auto/cmake/test_build_simple_widget_app/test_build_simple_widget_app.pro
@@ -0,0 +1,5 @@
+TEMPLATE = app
+SOURCES += main.cpp
+QT += widgets
+CONFIG += app_bundle
+TARGET = simple_widget_app
diff --git a/tests/auto/cmake/test_collecting_plugins/CMakeLists.txt b/tests/auto/cmake/test_collecting_plugins/CMakeLists.txt
new file mode 100644
index 0000000000..246acd4c71
--- /dev/null
+++ b/tests/auto/cmake/test_collecting_plugins/CMakeLists.txt
@@ -0,0 +1,31 @@
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+
+project(test_collecting_plugins
+ VERSION
+ "${CMAKE_Core_MODULE_MAJOR_VERSION}.${CMAKE_Core_MODULE_MINOR_VERSION}.${CMAKE_Core_MODULE_PATCH_VERSION}")
+
+find_package(Qt6 COMPONENTS Core Gui BuildInternals REQUIRED)
+
+qt_prepare_standalone_project()
+
+qt_internal_add_plugin(QTestImagePlugin
+ SHARED
+ PLUGIN_TYPE imageformats
+ SOURCES
+ plugin.cpp
+ LIBRARIES
+ Qt6::Gui
+ SKIP_INSTALL # Make sure that we do not package this plugin
+)
+
+qt_add_executable(TestExecutable main.cpp)
+target_link_libraries(TestExecutable PRIVATE Qt6::Gui)
+
+__qt_internal_collect_plugin_targets_from_dependencies(TestExecutable plugin_targets)
+
+if(NOT "QTestImagePlugin" IN_LIST plugin_targets)
+ message(FATAL_ERROR "QTestImagePlugin plugin is missing")
+endif()
diff --git a/tests/auto/cmake/test_collecting_plugins/main.cpp b/tests/auto/cmake/test_collecting_plugins/main.cpp
new file mode 100644
index 0000000000..09225de205
--- /dev/null
+++ b/tests/auto/cmake/test_collecting_plugins/main.cpp
@@ -0,0 +1,7 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+int main(int, char *[])
+{
+ return 0;
+}
diff --git a/tests/auto/cmake/test_collecting_plugins/plugin.cpp b/tests/auto/cmake/test_collecting_plugins/plugin.cpp
new file mode 100644
index 0000000000..f844d86c4e
--- /dev/null
+++ b/tests/auto/cmake/test_collecting_plugins/plugin.cpp
@@ -0,0 +1,18 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include <qimageiohandler.h>
+
+class TestImagePlugin : public QImageIOPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface")
+public:
+ Capabilities capabilities(QIODevice *, const QByteArray &) const override { return {}; }
+ QImageIOHandler *create(QIODevice *, const QByteArray & = QByteArray()) const override
+ {
+ return nullptr;
+ }
+};
+
+#include "plugin.moc"
diff --git a/tests/auto/cmake/test_concurrent_module/CMakeLists.txt b/tests/auto/cmake/test_concurrent_module/CMakeLists.txt
index 3294535319..f2d108274c 100644
--- a/tests/auto/cmake/test_concurrent_module/CMakeLists.txt
+++ b/tests/auto/cmake/test_concurrent_module/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_concurrent_module/main.cpp b/tests/auto/cmake/test_concurrent_module/main.cpp
index afecfadf27..9412c60638 100644
--- a/tests/auto/cmake/test_concurrent_module/main.cpp
+++ b/tests/auto/cmake/test_concurrent_module/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtConcurrent>
#include <QtConcurrent/QtConcurrent>
diff --git a/tests/auto/cmake/test_config_expressions/CMakeLists.txt b/tests/auto/cmake/test_config_expressions/CMakeLists.txt
new file mode 100644
index 0000000000..e3863b738a
--- /dev/null
+++ b/tests/auto/cmake/test_config_expressions/CMakeLists.txt
@@ -0,0 +1,134 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+
+project(test_config_expressions)
+
+find_package(Qt6 REQUIRED)
+include(QtFeature)
+
+function(assert expected_value)
+ set(expression ${ARGN})
+ qt_evaluate_config_expression(result ${expression})
+ if(NOT "${result}" STREQUAL "${expected_value}")
+ message(FATAL_ERROR
+ "Unexpected value '${result}' when evaluating expression '${expression}'.")
+ endif()
+endfunction()
+
+function(assert_T)
+ assert(ON ${ARGN})
+endfunction()
+
+function(assert_F)
+ assert(OFF ${ARGN})
+endfunction()
+
+function(expect_failure expected_value)
+ set(expression ${ARGN})
+ qt_evaluate_config_expression(result ${expression})
+ if("${result}" STREQUAL "${expected_value}")
+ message(FATAL_ERROR
+ "Expression '${expression}' unexpectedly evaluated to the correct value '${result}'.")
+ endif()
+endfunction()
+
+function(expect_failure_T)
+ expect_failure(ON ${ARGN})
+endfunction()
+
+function(expect_failure_F)
+ expect_failure(OFF ${ARGN})
+endfunction()
+
+assert_T(ON)
+assert_T(TRUE)
+assert_F(OFF)
+assert_F(FALSE)
+
+assert_T(NOT FALSE)
+assert_F(NOT TRUE)
+
+assert_T(TRUE OR TRUE)
+assert_T(TRUE OR FALSE)
+assert_T(FALSE OR TRUE)
+assert_F(FALSE OR FALSE)
+
+assert_T(TRUE AND TRUE)
+assert_F(TRUE AND FALSE)
+assert_F(FALSE AND TRUE)
+assert_F(FALSE AND FALSE)
+
+# string comparison
+set(str1 "foo")
+set(str2 "bar")
+assert_T(str1 STREQUAL "foo")
+assert_T(str1 STREQUAL 'foo')
+expect_failure_T(str1 STREQUAL str1) # variable on rhs not supported
+expect_failure_T("foo" STREQUAL "foo") # literal on lhs not supported
+expect_failure_T('foo' STREQUAL 'foo') # literal on lhs not supported
+
+# comparison with empty string
+set(empty_string "")
+assert_T(empty_string STREQUAL '')
+assert_F(empty_string STREQUAL "x")
+
+# string matching
+set(processor ppc64)
+assert_T(${processor} MATCHES "(ppc|ppc64)$")
+assert_F(${processor} MATCHES "i[3-6]86$")
+
+# logical operators and parentheses
+set(A TRUE)
+set(B FALSE)
+set(C TRUE)
+assert_F(B OR B)
+assert_F(A AND B)
+assert_T(A AND (B OR C))
+assert_T((A AND B) OR C)
+assert_T((A AND B) OR (NOT B AND C))
+assert_F(NOT (B OR C))
+assert_T(NOT (A AND B))
+assert_F(NOT (B OR C))
+
+# target check
+set(lib1_cpp "${CMAKE_CURRENT_BINARY_DIR}/lib1.cpp")
+file(WRITE "${lib1_cpp}" "int foo() { return 42; }")
+add_library(lib1 STATIC EXCLUDE_FROM_ALL "${lib1_cpp}")
+assert_T(TARGET lib1)
+assert_F(TARGET does_not_exist)
+
+# IN_LIST
+set(primary_colors red yellow blue)
+assert_T(yellow IN_LIST primary_colors)
+assert_F(mauve IN_LIST primary_colors)
+
+# more complex string check from a real world feature
+set(INPUT_xcb "")
+set(INPUT_xkbcommon no)
+assert_F(NOT INPUT_xcb STREQUAL '' AND ( NOT INPUT_xcb STREQUAL 'no' )
+ AND INPUT_xkbcommon STREQUAL 'no')
+set(INPUT_xcb no)
+set(INPUT_xkbcommon no)
+assert_F(NOT INPUT_xcb STREQUAL '' AND ( NOT INPUT_xcb STREQUAL 'no' )
+ AND INPUT_xkbcommon STREQUAL 'no')
+set(INPUT_xcb yes)
+set(INPUT_xkbcommon no)
+assert_T(NOT INPUT_xcb STREQUAL '' AND ( NOT INPUT_xcb STREQUAL 'no' )
+ AND INPUT_xkbcommon STREQUAL 'no')
+set(INPUT_xcb no)
+set(INPUT_xkbcommon yes)
+assert_F(NOT INPUT_xcb STREQUAL '' AND ( NOT INPUT_xcb STREQUAL 'no' )
+ AND INPUT_xkbcommon STREQUAL 'no')
+
+set(FEATURE_shared ON)
+set(FEATURE_debug ON)
+set(FEATURE_debug_and_release OFF)
+set(FEATURE_force_debug_info OFF)
+set(TEST_separate_debug_info ON)
+assert_T(
+ ( FEATURE_shared )
+ AND ( FEATURE_debug OR FEATURE_debug_and_release OR FEATURE_force_debug_info )
+ AND ( MSVC OR APPLE OR TEST_separate_debug_info )
+)
diff --git a/tests/auto/cmake/test_dbus_module/CMakeLists.txt b/tests/auto/cmake/test_dbus_module/CMakeLists.txt
index 6159456197..014aae974c 100644
--- a/tests/auto/cmake/test_dbus_module/CMakeLists.txt
+++ b/tests/auto/cmake/test_dbus_module/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_dbus_module/mydbusobject.cpp b/tests/auto/cmake/test_dbus_module/mydbusobject.cpp
index 356b09d2fa..c9420812b4 100644
--- a/tests/auto/cmake/test_dbus_module/mydbusobject.cpp
+++ b/tests/auto/cmake/test_dbus_module/mydbusobject.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "mydbusobject.h"
#include "mydbusobjectadaptor.h"
diff --git a/tests/auto/cmake/test_dbus_module/mydbusobject.h b/tests/auto/cmake/test_dbus_module/mydbusobject.h
index 3559ecd4dc..8a95c99f04 100644
--- a/tests/auto/cmake/test_dbus_module/mydbusobject.h
+++ b/tests/auto/cmake/test_dbus_module/mydbusobject.h
@@ -1,5 +1,5 @@
// Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef MYDBUSOBJECT_H
#define MYDBUSOBJECT_H
diff --git a/tests/auto/cmake/test_dependent_modules/CMakeLists.txt b/tests/auto/cmake/test_dependent_modules/CMakeLists.txt
index 679f7fed27..47ced6ccda 100644
--- a/tests/auto/cmake/test_dependent_modules/CMakeLists.txt
+++ b/tests/auto/cmake/test_dependent_modules/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_dependent_modules/mywidget.cpp b/tests/auto/cmake/test_dependent_modules/mywidget.cpp
index c0e3870c91..da7f51d286 100644
--- a/tests/auto/cmake/test_dependent_modules/mywidget.cpp
+++ b/tests/auto/cmake/test_dependent_modules/mywidget.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "mywidget.h"
#include "ui_mywidget.h"
diff --git a/tests/auto/cmake/test_dependent_modules/mywidget.h b/tests/auto/cmake/test_dependent_modules/mywidget.h
index 8b8e2ee350..4517670b56 100644
--- a/tests/auto/cmake/test_dependent_modules/mywidget.h
+++ b/tests/auto/cmake/test_dependent_modules/mywidget.h
@@ -1,5 +1,5 @@
// Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef MYWIDGET_H
#define MYWIDGET_H
diff --git a/tests/auto/cmake/test_egl_lib/main.cpp b/tests/auto/cmake/test_egl_lib/main.cpp
index 39d4d8b14c..b5faa46dd3 100644
--- a/tests/auto/cmake/test_egl_lib/main.cpp
+++ b/tests/auto/cmake/test_egl_lib/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <EGL/egl.h>
diff --git a/tests/auto/cmake/test_generating_cpp_exports/.cmake.conf b/tests/auto/cmake/test_generating_cpp_exports/.cmake.conf
index 377be0059e..10bc1fd407 100644
--- a/tests/auto/cmake/test_generating_cpp_exports/.cmake.conf
+++ b/tests/auto/cmake/test_generating_cpp_exports/.cmake.conf
@@ -1 +1 @@
-set(QT_REPO_MODULE_VERSION "6.5.0")
+set(QT_REPO_MODULE_VERSION "6.8.0")
diff --git a/tests/auto/cmake/test_generating_cpp_exports/CMakeLists.txt b/tests/auto/cmake/test_generating_cpp_exports/CMakeLists.txt
index 7b5666c3f7..564d23ca05 100644
--- a/tests/auto/cmake/test_generating_cpp_exports/CMakeLists.txt
+++ b/tests/auto/cmake/test_generating_cpp_exports/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
include(.cmake.conf)
@@ -10,10 +13,12 @@ project(TestGeneratingCppExports
)
find_package(Qt6 COMPONENTS Core BuildInternals Test CONFIG REQUIRED)
+qt_internal_project_setup()
qt_build_repo_begin()
add_subdirectory(test_autogenerating_cpp_exports)
add_subdirectory(test_autogenerating_cpp_exports_custom_name)
+qt_build_repo_post_process()
qt_build_repo_end()
diff --git a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/CMakeLists.txt b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/CMakeLists.txt
index 805bce2a93..0e446dd108 100644
--- a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/CMakeLists.txt
+++ b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/CMakeLists.txt
@@ -1,4 +1,8 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
qt_internal_add_module(TestAutogeneratingCppExports
+ NO_UNITY_BUILD
GENERATE_CPP_EXPORTS
SOURCES
module_api.h
@@ -15,3 +19,4 @@ qt_internal_extend_target(TestAutogeneratingCppExports
add_executable(TestAutogeneratingCppExportsApp use_api.cpp)
target_link_libraries(TestAutogeneratingCppExportsApp PRIVATE TestAutogeneratingCppExports)
+set_target_properties(TestAutogeneratingCppExportsApp PROPERTIES UNITY_BUILD OFF)
diff --git a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/module_api.cpp b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/module_api.cpp
index 53eab3ef6f..e77895e719 100644
--- a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/module_api.cpp
+++ b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/module_api.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "module_api.h"
diff --git a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/module_api.h b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/module_api.h
index a6c20fb402..6c8112c617 100644
--- a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/module_api.h
+++ b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/module_api.h
@@ -1,9 +1,14 @@
// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef MODULE_API_H
#define MODULE_API_H
+#if 0
+#pragma qt_sync_skip_header_check
+#pragma qt_sync_stop_processing
+#endif
+
#include <QtTestAutogeneratingCppExports/qttestautogeneratingcppexportsexports.h>
struct Q_TESTAUTOGENERATINGCPPEXPORTS_EXPORT TestApi
diff --git a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/use_api.cpp b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/use_api.cpp
index 5bce4e524e..f84931300f 100644
--- a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/use_api.cpp
+++ b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports/use_api.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "module_api.h"
diff --git a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/CMakeLists.txt b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/CMakeLists.txt
index e1735a3f9f..8473979c70 100644
--- a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/CMakeLists.txt
+++ b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/CMakeLists.txt
@@ -1,4 +1,8 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
qt_internal_add_module(TestAutogeneratingCppExportsCustomName
+ NO_UNITY_BUILD
GENERATE_CPP_EXPORTS
CPP_EXPORT_HEADER_BASE_NAME
"customname_exports"
@@ -17,3 +21,4 @@ qt_internal_extend_target(TestAutogeneratingCppExportsCustomName
add_executable(testapp2 use_api.cpp)
target_link_libraries(testapp2 PRIVATE TestAutogeneratingCppExportsCustomName)
+set_target_properties(testapp2 PROPERTIES UNITY_BUILD OFF)
diff --git a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/module_api.cpp b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/module_api.cpp
index 53eab3ef6f..e77895e719 100644
--- a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/module_api.cpp
+++ b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/module_api.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "module_api.h"
diff --git a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/module_api.h b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/module_api.h
index 961a631c80..62c1b31ac4 100644
--- a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/module_api.h
+++ b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/module_api.h
@@ -1,9 +1,14 @@
// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef MODULE_API_H
#define MODULE_API_H
+#if 0
+#pragma qt_sync_skip_header_check
+#pragma qt_sync_stop_processing
+#endif
+
#include <QtTestAutogeneratingCppExportsCustomName/customname_exports.h>
struct Q_TESTAUTOGENERATINGCPPEXPORTSCUSTOMNAME_EXPORT TestApi
diff --git a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/use_api.cpp b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/use_api.cpp
index 5bce4e524e..f84931300f 100644
--- a/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/use_api.cpp
+++ b/tests/auto/cmake/test_generating_cpp_exports/test_autogenerating_cpp_exports_custom_name/use_api.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "module_api.h"
diff --git a/tests/auto/cmake/test_global_promotion/CMakeLists.txt b/tests/auto/cmake/test_global_promotion/CMakeLists.txt
index 1ad6c5e7ad..24b2eacaf1 100644
--- a/tests/auto/cmake/test_global_promotion/CMakeLists.txt
+++ b/tests/auto/cmake/test_global_promotion/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(global_promotion)
diff --git a/tests/auto/cmake/test_global_promotion/subdir_with_global_qt/CMakeLists.txt b/tests/auto/cmake/test_global_promotion/subdir_with_global_qt/CMakeLists.txt
index a8808a8c83..26e3d6e025 100644
--- a/tests/auto/cmake/test_global_promotion/subdir_with_global_qt/CMakeLists.txt
+++ b/tests/auto/cmake/test_global_promotion/subdir_with_global_qt/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
message(STATUS "Entered subdir_with_global_qt subdirectory")
set(file_path "${CMAKE_CURRENT_BINARY_DIR}/lib.cpp")
diff --git a/tests/auto/cmake/test_global_promotion/subdir_with_local_qt/CMakeLists.txt b/tests/auto/cmake/test_global_promotion/subdir_with_local_qt/CMakeLists.txt
index 1bed5a2f99..820282b7c1 100644
--- a/tests/auto/cmake/test_global_promotion/subdir_with_local_qt/CMakeLists.txt
+++ b/tests/auto/cmake/test_global_promotion/subdir_with_local_qt/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
message(STATUS "Entered subdir_with_local_qt subdirectory")
set(file_path "${CMAKE_CURRENT_BINARY_DIR}/lib.cpp")
diff --git a/tests/auto/cmake/test_import_plugins/CMakeLists.txt b/tests/auto/cmake/test_import_plugins/CMakeLists.txt
index be85af2091..5f6d629c20 100644
--- a/tests/auto/cmake/test_import_plugins/CMakeLists.txt
+++ b/tests/auto/cmake/test_import_plugins/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(import_plugins_advanced)
diff --git a/tests/auto/cmake/test_import_plugins/main.cpp b/tests/auto/cmake/test_import_plugins/main.cpp
index 8de124c41d..69293f3abd 100644
--- a/tests/auto/cmake/test_import_plugins/main.cpp
+++ b/tests/auto/cmake/test_import_plugins/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2018 Kitware, Inc.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QList>
#include <QPluginLoader>
diff --git a/tests/auto/cmake/test_interface/CMakeLists.txt b/tests/auto/cmake/test_interface/CMakeLists.txt
index 22e9a0b3ac..7028b41f7b 100644
--- a/tests/auto/cmake/test_interface/CMakeLists.txt
+++ b/tests/auto/cmake/test_interface/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_interface/main.cpp b/tests/auto/cmake/test_interface/main.cpp
index a8f072aff3..56b442a4ce 100644
--- a/tests/auto/cmake/test_interface/main.cpp
+++ b/tests/auto/cmake/test_interface/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QApplication>
diff --git a/tests/auto/cmake/test_interface/mainwindow.cpp b/tests/auto/cmake/test_interface/mainwindow.cpp
index 878265f9c3..2fec6400f6 100644
--- a/tests/auto/cmake/test_interface/mainwindow.cpp
+++ b/tests/auto/cmake/test_interface/mainwindow.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "mainwindow.h"
diff --git a/tests/auto/cmake/test_interface/mainwindow.h b/tests/auto/cmake/test_interface/mainwindow.h
index 1f938d2bd9..345c4f69e9 100644
--- a/tests/auto/cmake/test_interface/mainwindow.h
+++ b/tests/auto/cmake/test_interface/mainwindow.h
@@ -1,5 +1,5 @@
// Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
diff --git a/tests/auto/cmake/test_interface/widget_test/CMakeLists.txt b/tests/auto/cmake/test_interface/widget_test/CMakeLists.txt
index 229b1bf962..dd4c8fff28 100644
--- a/tests/auto/cmake/test_interface/widget_test/CMakeLists.txt
+++ b/tests/auto/cmake/test_interface/widget_test/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(test_interface_try_compile)
diff --git a/tests/auto/cmake/test_interface_link_libraries/CMakeLists.txt b/tests/auto/cmake/test_interface_link_libraries/CMakeLists.txt
index 28f8b9aefe..6a38d263cd 100644
--- a/tests/auto/cmake/test_interface_link_libraries/CMakeLists.txt
+++ b/tests/auto/cmake/test_interface_link_libraries/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_interface_link_libraries/main.cpp b/tests/auto/cmake/test_interface_link_libraries/main.cpp
index 75e6f22db0..7d4ca031db 100644
--- a/tests/auto/cmake/test_interface_link_libraries/main.cpp
+++ b/tests/auto/cmake/test_interface_link_libraries/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "somelib.h"
diff --git a/tests/auto/cmake/test_interface_link_libraries/somelib.cpp b/tests/auto/cmake/test_interface_link_libraries/somelib.cpp
index 106f534bb2..de51a8e60f 100644
--- a/tests/auto/cmake/test_interface_link_libraries/somelib.cpp
+++ b/tests/auto/cmake/test_interface_link_libraries/somelib.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "somelib.h"
diff --git a/tests/auto/cmake/test_interface_link_libraries/somelib.h b/tests/auto/cmake/test_interface_link_libraries/somelib.h
index 828937c13c..d2f0cfd554 100644
--- a/tests/auto/cmake/test_interface_link_libraries/somelib.h
+++ b/tests/auto/cmake/test_interface_link_libraries/somelib.h
@@ -1,5 +1,5 @@
// Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef SOMELIB_H
#define SOMELIB_H
diff --git a/tests/auto/cmake/test_json_plugin_includes/CMakeLists.txt b/tests/auto/cmake/test_json_plugin_includes/CMakeLists.txt
index 0f5dc99206..15ea1ccadf 100644
--- a/tests/auto/cmake/test_json_plugin_includes/CMakeLists.txt
+++ b/tests/auto/cmake/test_json_plugin_includes/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_json_plugin_includes/plugin.cpp b/tests/auto/cmake/test_json_plugin_includes/plugin.cpp
index 8979c56b77..5554fe737a 100644
--- a/tests/auto/cmake/test_json_plugin_includes/plugin.cpp
+++ b/tests/auto/cmake/test_json_plugin_includes/plugin.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "plugin.h"
diff --git a/tests/auto/cmake/test_json_plugin_includes/plugin.h b/tests/auto/cmake/test_json_plugin_includes/plugin.h
index 36e5eb55b2..7e3e9b4569 100644
--- a/tests/auto/cmake/test_json_plugin_includes/plugin.h
+++ b/tests/auto/cmake/test_json_plugin_includes/plugin.h
@@ -1,5 +1,5 @@
// Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef JSON_TEST_PLUGIN_H
#define JSON_TEST_PLUGIN_H
diff --git a/tests/auto/cmake/test_moc_macro_target/CMakeLists.txt b/tests/auto/cmake/test_moc_macro_target/CMakeLists.txt
index eaf8bda1bb..f9ca294bd2 100644
--- a/tests/auto/cmake/test_moc_macro_target/CMakeLists.txt
+++ b/tests/auto/cmake/test_moc_macro_target/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
@@ -11,7 +14,14 @@ qt_generate_moc(main_gen_test.cpp
"${CMAKE_CURRENT_BINARY_DIR}/main_gen_test.moc"
TARGET QtGenerateMacroTest
)
+list(APPEND CMAKE_AUTOMOC_MACRO_NAMES MySpecialMacro)
add_executable(QtGenerateMacroTest main_gen_test.cpp "${CMAKE_CURRENT_BINARY_DIR}/main_gen_test.moc")
+get_target_property(current_macros QtGenerateMacroTest AUTOMOC_MACRO_NAMES)
+
+if(NOT "${CMAKE_AUTOMOC_MACRO_NAMES}" STREQUAL "${current_macros}")
+ message(FATAL_ERROR "Expected ${CMAKE_AUTOMOC_MACRO_NAMES} but received ${current_macros}")
+endif()
+
target_include_directories(QtGenerateMacroTest PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/interface")
target_link_libraries(QtGenerateMacroTest PRIVATE Qt6::Core)
@@ -21,3 +31,25 @@ qt_wrap_cpp(moc_file mywrapobject.h
add_executable(QtWrapMacroTest main_wrap_test.cpp ${moc_file})
target_include_directories(QtWrapMacroTest PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/interface")
target_link_libraries(QtWrapMacroTest PRIVATE Qt::Core)
+
+target_compile_definitions(QtWrapMacroTest PRIVATE "$<$<BOOL:TRUE>:MY_OPTION>"
+ "$<$<BOOL:TRUE>:DEFINE_CMDLINE_SIGNAL=void cmdlineSignal(const QMap<int$<COMMA> int$<ANGLE-R> &i)>"
+ "DEFINE_CMDLINE_SIGNAL=void cmdlineSignal(const QMap<int, int> &i)")
+
+set(parameters_file_base "${CMAKE_CURRENT_BINARY_DIR}/moc_mywrapobject.cpp_parameters")
+# check if generator is multi-config
+if(CMAKE_CONFIGURATION_TYPES)
+ set(parameters_file "${parameters_file_base}_$<CONFIG>")
+else()
+ if(NOT CMAKE_BUILD_TYPE STREQUAL "")
+ set(parameters_file "${parameters_file_base}_${CMAKE_BUILD_TYPE}")
+ else()
+ set(parameters_file "${parameters_file_base}")
+ endif()
+endif()
+
+add_custom_command(TARGET QtWrapMacroTest
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} "-DPARAMETERS_FILE_PATH=${parameters_file}" -P check_moc_parameters.cmake
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+)
diff --git a/tests/auto/cmake/test_moc_macro_target/check_moc_parameters.cmake b/tests/auto/cmake/test_moc_macro_target/check_moc_parameters.cmake
new file mode 100644
index 0000000000..4ca8fab119
--- /dev/null
+++ b/tests/auto/cmake/test_moc_macro_target/check_moc_parameters.cmake
@@ -0,0 +1,15 @@
+
+function(check_parameters file_path)
+ file(READ ${file_path} file_content)
+ foreach(compile_option IN ITEMS "-DDEFINE_CMDLINE_SIGNAL" "-DMY_OPTION")
+ string(REGEX MATCHALL "${compile_option}" matches ${file_content})
+ list(LENGTH matches matches_length)
+ if(matches_length GREATER 1)
+ message(FATAL_ERROR "${compile_option} is defined multiple times in ${file_path}")
+ elseif(matches_length EQUAL 0)
+ message(FATAL_ERROR "${compile_option} is not defined in ${file_path}")
+ endif()
+ endforeach()
+endfunction()
+
+check_parameters(${PARAMETERS_FILE_PATH})
diff --git a/tests/auto/cmake/test_moc_macro_target/interface/myinterface.h b/tests/auto/cmake/test_moc_macro_target/interface/myinterface.h
index 60ff102037..3c18c9a10d 100644
--- a/tests/auto/cmake/test_moc_macro_target/interface/myinterface.h
+++ b/tests/auto/cmake/test_moc_macro_target/interface/myinterface.h
@@ -1,5 +1,5 @@
// Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef MYINTERFACE_H
#define MYINTERFACE_H
diff --git a/tests/auto/cmake/test_moc_macro_target/main_gen_test.cpp b/tests/auto/cmake/test_moc_macro_target/main_gen_test.cpp
index 5ffb740e9d..ef58aa025a 100644
--- a/tests/auto/cmake/test_moc_macro_target/main_gen_test.cpp
+++ b/tests/auto/cmake/test_moc_macro_target/main_gen_test.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QObject>
diff --git a/tests/auto/cmake/test_moc_macro_target/main_wrap_test.cpp b/tests/auto/cmake/test_moc_macro_target/main_wrap_test.cpp
index 2f403d95c6..bf4b6193fe 100644
--- a/tests/auto/cmake/test_moc_macro_target/main_wrap_test.cpp
+++ b/tests/auto/cmake/test_moc_macro_target/main_wrap_test.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QObject>
diff --git a/tests/auto/cmake/test_moc_macro_target/mywrapobject.h b/tests/auto/cmake/test_moc_macro_target/mywrapobject.h
index 7398cce9ee..28030a5832 100644
--- a/tests/auto/cmake/test_moc_macro_target/mywrapobject.h
+++ b/tests/auto/cmake/test_moc_macro_target/mywrapobject.h
@@ -1,5 +1,5 @@
// Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef MYWRAPOBJECT_H
#define MYWRAPOBJECT_H
diff --git a/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt b/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt
index 48864f2b22..1b50c204ca 100644
--- a/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt
+++ b/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_multiple_find_package/main.cpp b/tests/auto/cmake/test_multiple_find_package/main.cpp
index 7db90ad9c5..820a550917 100644
--- a/tests/auto/cmake/test_multiple_find_package/main.cpp
+++ b/tests/auto/cmake/test_multiple_find_package/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtCore/QString>
diff --git a/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt b/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt
index 61a273424e..abf9abf8a7 100644
--- a/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt
+++ b/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
find_package(Qt6Core REQUIRED)
diff --git a/tests/auto/cmake/test_opengl_lib/CMakeLists.txt b/tests/auto/cmake/test_opengl_lib/CMakeLists.txt
index 020d7fbf2a..b5672b4393 100644
--- a/tests/auto/cmake/test_opengl_lib/CMakeLists.txt
+++ b/tests/auto/cmake/test_opengl_lib/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_opengl_lib/main.cpp b/tests/auto/cmake/test_opengl_lib/main.cpp
index 86cdd29a48..b29d11f667 100644
--- a/tests/auto/cmake/test_opengl_lib/main.cpp
+++ b/tests/auto/cmake/test_opengl_lib/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qglobal.h>
diff --git a/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt b/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt
index 34a22b056a..ab3a935894 100644
--- a/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt
+++ b/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_platform_defs_include/main.cpp b/tests/auto/cmake/test_platform_defs_include/main.cpp
index 5e61b3f393..30d2e2065a 100644
--- a/tests/auto/cmake/test_platform_defs_include/main.cpp
+++ b/tests/auto/cmake/test_platform_defs_include/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "qplatformdefs.h"
diff --git a/tests/auto/cmake/test_plugin_shared_static_flavor.cmake b/tests/auto/cmake/test_plugin_shared_static_flavor.cmake
index a906bfebbc..ffe5fb5447 100644
--- a/tests/auto/cmake/test_plugin_shared_static_flavor.cmake
+++ b/tests/auto/cmake/test_plugin_shared_static_flavor.cmake
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
_qt_internal_test_expect_pass(test_plugin_shared_static_flavor
TESTNAME test_plugin_flavor_static
BUILD_OPTIONS
diff --git a/tests/auto/cmake/test_plugin_shared_static_flavor/CMakeLists.txt b/tests/auto/cmake/test_plugin_shared_static_flavor/CMakeLists.txt
index 0a79038e8a..fda0c69d07 100644
--- a/tests/auto/cmake/test_plugin_shared_static_flavor/CMakeLists.txt
+++ b/tests/auto/cmake/test_plugin_shared_static_flavor/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(test_plugin_flavor)
diff --git a/tests/auto/cmake/test_plugins/CMakeLists.txt b/tests/auto/cmake/test_plugins/CMakeLists.txt
index 9870db9ce4..5b6c4eea4e 100644
--- a/tests/auto/cmake/test_plugins/CMakeLists.txt
+++ b/tests/auto/cmake/test_plugins/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_private_includes/CMakeLists.txt b/tests/auto/cmake/test_private_includes/CMakeLists.txt
index 402ae73def..d4ba8ab888 100644
--- a/tests/auto/cmake/test_private_includes/CMakeLists.txt
+++ b/tests/auto/cmake/test_private_includes/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_private_includes/main.cpp b/tests/auto/cmake/test_private_includes/main.cpp
index fee93f978d..6dc90fbae0 100644
--- a/tests/auto/cmake/test_private_includes/main.cpp
+++ b/tests/auto/cmake/test_private_includes/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QGuiApplication>
#include <QScreen>
diff --git a/tests/auto/cmake/test_private_targets/CMakeLists.txt b/tests/auto/cmake/test_private_targets/CMakeLists.txt
index f703b7af20..72e06b044c 100644
--- a/tests/auto/cmake/test_private_targets/CMakeLists.txt
+++ b/tests/auto/cmake/test_private_targets/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_private_targets/main.cpp b/tests/auto/cmake/test_private_targets/main.cpp
index 509d27d23b..4566fd6ce6 100644
--- a/tests/auto/cmake/test_private_targets/main.cpp
+++ b/tests/auto/cmake/test_private_targets/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2016 Stephen Kelly <steveire@gmail.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QGuiApplication>
diff --git a/tests/auto/cmake/test_qt_add_resources_rebuild/CMakeLists.txt b/tests/auto/cmake/test_qt_add_resources_rebuild/CMakeLists.txt
new file mode 100644
index 0000000000..e7b35b332f
--- /dev/null
+++ b/tests/auto/cmake/test_qt_add_resources_rebuild/CMakeLists.txt
@@ -0,0 +1,123 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+
+project(test_qt_add_resources_rebuild)
+
+set(test_project_source_dir "${CMAKE_CURRENT_SOURCE_DIR}/sample")
+set(test_project_build_dir "${CMAKE_CURRENT_BINARY_DIR}/build_sample")
+
+# Make sure that file paths are 'real' paths
+get_filename_component(test_project_source_dir "${test_project_source_dir}" REALPATH)
+get_filename_component(test_project_build_dir "${test_project_build_dir}" REALPATH)
+
+file(REMOVE_RECURSE "${test_project_build_dir}")
+file(MAKE_DIRECTORY "${test_project_build_dir}")
+
+# For access to _qt_internal_get_cmake_test_configure_options
+find_package(Qt6 COMPONENTS Core REQUIRED)
+include("${_Qt6CTestMacros}")
+
+set(indent " ")
+list(APPEND CMAKE_MESSAGE_INDENT "${indent}")
+
+function(configure_project)
+ message(STATUS "Configuring build")
+ _qt_internal_get_cmake_test_configure_options(option_list)
+ execute_process(COMMAND
+ "${CMAKE_COMMAND}"
+ "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}"
+ "-G${CMAKE_GENERATOR}"
+ ${option_list}
+ -B "${test_project_build_dir}"
+ -S "${test_project_source_dir}"
+ RESULT_VARIABLE result
+ )
+ if(NOT result EQUAL 0)
+ message(FATAL_ERROR "Unable to configure sample project")
+ endif()
+endfunction()
+
+function(try_build)
+ message(STATUS "Building project")
+ execute_process(COMMAND
+ "${CMAKE_COMMAND}"
+ --build "${test_project_build_dir}"
+ RESULT_VARIABLE result
+ )
+ if(NOT result EQUAL 0)
+ message(FATAL_ERROR "Unable to build test project")
+ endif()
+endfunction()
+
+function(get_target_path out_var)
+ file(STRINGS "${test_project_build_dir}/targets.txt" targets)
+ list(GET targets 0 first_target_path)
+ message(STATUS "Built target is at '${first_target_path}'")
+ set(${out_var} "${first_target_path}" PARENT_SCOPE)
+endfunction()
+
+function(get_timestamp file_path out_var)
+ message(STATUS "Getting timestamp of built target.")
+ file(TIMESTAMP "${file_path}" value "%s")
+ set(${out_var} "${value}" PARENT_SCOPE)
+endfunction()
+
+function(sleep)
+ # Avoids issues with low resolution modification times (like HFS on macOS).
+ set(seconds 2)
+ message(STATUS "Sleeping for ${seconds} seconds.")
+ execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep ${seconds})
+endfunction()
+
+function(touch_file)
+ set(input "input.ts")
+ set(input_path "${test_project_source_dir}/${input}")
+ message(STATUS "Touching ${input_path}")
+ file(TOUCH "${input_path}")
+endfunction()
+
+function(assert_timestamp_is_equal before after)
+ set(timestamps "\n${indent}Before TS: ${before}\n${indent} After TS: ${after}")
+ if("${after}" EQUAL "${before}")
+ message(STATUS "Target was not rebuilt. ${timestamps}")
+ else()
+ message(FATAL_ERROR "Target WAS rebuilt. ${timestamps}")
+ endif()
+endfunction()
+
+function(assert_timestamp_is_greater before after)
+ set(timestamps "\n${indent}Before TS: ${before}\n${indent} After TS: ${after}")
+ if("${after}" GREATER "${before}")
+ message(STATUS "Target was correctly rebuilt. ${timestamps}")
+ else()
+ message(FATAL_ERROR "Target was NOT rebuilt. ${timestamps}")
+ endif()
+endfunction()
+
+configure_project()
+try_build()
+get_target_path(target_path)
+
+# Make sure that a second build without changes doesn't rebuild the executable.
+get_timestamp("${target_path}" ts_1)
+sleep()
+try_build()
+get_timestamp("${target_path}" ts_2)
+assert_timestamp_is_equal("${ts_1}" "${ts_2}")
+
+# Touching the input file should cause rcc to rerun, then the compiler, then the linker,
+# and thus the executable timestamp should be updated.
+touch_file()
+try_build()
+get_timestamp("${target_path}" ts_3)
+assert_timestamp_is_greater("${ts_2}" "${ts_3}")
+
+# Check that building again doesn't rebuild the executable.
+sleep()
+try_build()
+get_timestamp("${target_path}" ts_4)
+assert_timestamp_is_equal("${ts_3}" "${ts_4}")
+
+list(POP_BACK CMAKE_MESSAGE_INDENT)
diff --git a/tests/auto/cmake/test_qt_add_resources_rebuild/sample/CMakeLists.txt b/tests/auto/cmake/test_qt_add_resources_rebuild/sample/CMakeLists.txt
new file mode 100644
index 0000000000..0a40a948c6
--- /dev/null
+++ b/tests/auto/cmake/test_qt_add_resources_rebuild/sample/CMakeLists.txt
@@ -0,0 +1,45 @@
+cmake_minimum_required(VERSION 3.16)
+project(sample LANGUAGES CXX)
+
+find_package(Qt6 REQUIRED COMPONENTS Core)
+
+set(source "${CMAKE_BINARY_DIR}/main.cpp")
+file(GENERATE OUTPUT "${source}" CONTENT "int main() { return 0; }")
+
+qt_add_executable(${PROJECT_NAME} ${source})
+
+# This is a poor man's implementation of qt_add_lupdate.
+set(input "${CMAKE_SOURCE_DIR}/input.ts")
+set(output "${CMAKE_BINARY_DIR}/output.qm")
+add_custom_command(
+ OUTPUT "${output}"
+ COMMAND ${CMAKE_COMMAND} -E copy "${input}" "${output}"
+ DEPENDS "${input}"
+ VERBATIM
+)
+
+# This is where the bug happened before. Adding the target dependency properties used the target
+# as an order-only dependency, instead of depending on the actual dependency file.
+set_source_files_properties("${output}"
+ PROPERTIES _qt_resource_target_dependency "output_target")
+
+add_custom_target(output_target
+ DEPENDS "${output}"
+)
+
+qt_add_resources(${PROJECT_NAME} "res"
+ PREFIX "/"
+ BASE "${CMAKE_CURRENT_BINARY_DIR}"
+ FILES "${output}"
+)
+
+# Write out the location of the binary so its timestamp can be checked by the driving parent
+# project.
+set(target_file_out "${CMAKE_BINARY_DIR}/targets.txt")
+add_custom_target(all_built ALL
+ COMMAND
+ ${CMAKE_COMMAND} -E echo "$<TARGET_FILE:${PROJECT_NAME}>" > "${target_file_out}"
+ VERBATIM
+)
+# Make sure the file path is written out after the executable is linked.
+add_dependencies(all_built ${PROJECT_NAME})
diff --git a/tests/auto/cmake/test_qt_add_resources_rebuild/sample/input.ts b/tests/auto/cmake/test_qt_add_resources_rebuild/sample/input.ts
new file mode 100644
index 0000000000..20a96e90c4
--- /dev/null
+++ b/tests/auto/cmake/test_qt_add_resources_rebuild/sample/input.ts
@@ -0,0 +1 @@
+bonk
diff --git a/tests/auto/cmake/test_qt_extract_metatypes/CMakeLists.txt b/tests/auto/cmake/test_qt_extract_metatypes/CMakeLists.txt
index 51d78dd833..26944b1192 100644
--- a/tests/auto/cmake/test_qt_extract_metatypes/CMakeLists.txt
+++ b/tests/auto/cmake/test_qt_extract_metatypes/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(test_qt_extract_metatypes VERSION 0.1 LANGUAGES CXX)
diff --git a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/CMakeLists.txt b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/CMakeLists.txt
index 88e51a0ed1..328f20aaab 100644
--- a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/CMakeLists.txt
+++ b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(qt_extract_metatypes_test_project VERSION 0.1 LANGUAGES CXX)
diff --git a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/MetaType.cpp b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/MetaType.cpp
index f133f67d05..40fb1dffbe 100644
--- a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/MetaType.cpp
+++ b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/MetaType.cpp
@@ -1,4 +1,4 @@
// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "MetaType.h"
diff --git a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/main.cpp b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/main.cpp
index 670f038749..b141c894ab 100644
--- a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/main.cpp
+++ b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
int main(int argc, char *argv[])
{
diff --git a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeEmpty.h b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeEmpty.h
index cc5c4a772d..bcd7594d9a 100644
--- a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeEmpty.h
+++ b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeEmpty.h
@@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#pragma once
diff --git a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeEmptyWithComment.h b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeEmptyWithComment.h
index 08c84c85c3..1c38ae2f5e 100644
--- a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeEmptyWithComment.h
+++ b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeEmptyWithComment.h
@@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#pragma once
diff --git a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeQ_OBJECT.h b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeQ_OBJECT.h
index d2e4db9314..104dd6d7a9 100644
--- a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeQ_OBJECT.h
+++ b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeQ_OBJECT.h
@@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#pragma once
#include <QObject>
diff --git a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeQ_OBJECTandQ_PROPERTY.h b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeQ_OBJECTandQ_PROPERTY.h
index 56d6c56bb5..f3a9ececb7 100644
--- a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeQ_OBJECTandQ_PROPERTY.h
+++ b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/MetaTypeQ_OBJECTandQ_PROPERTY.h
@@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#pragma once
diff --git a/tests/auto/cmake/test_qt_manual_moc/CMakeLists.txt b/tests/auto/cmake/test_qt_manual_moc/CMakeLists.txt
new file mode 100644
index 0000000000..513995c4cf
--- /dev/null
+++ b/tests/auto/cmake/test_qt_manual_moc/CMakeLists.txt
@@ -0,0 +1,61 @@
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+
+find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core)
+
+set(CMAKE_AUTOMOC FALSE)
+
+qt_manual_moc(moc_files testclass.h
+ DEFINITIONS
+ -DMY_FIRST_DEF
+ MY_SECOND_DEF
+ -DMY_THIRD_DEF=1
+ MY_FOURTH_DEF=1
+)
+
+add_custom_target(verify_testclass ALL COMMAND ${CMAKE_COMMAND}
+ "-DMOC_ARGS=moc_testclass.cpp_parameters$<$<BOOL:$<CONFIG>>:_$<CONFIG>>"
+ "-DDEFINITIONS=MY_FIRST_DEF;MY_SECOND_DEF;MY_THIRD_DEF=1;MY_FOURTH_DEF=1"
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/VerifyDefines.cmake"
+ VERBATIM
+)
+
+add_library(MyInterfaceLib INTERFACE)
+target_compile_definitions(MyInterfaceLib INTERFACE -DMY_TRANSITIVE_DEF=1)
+
+add_library(MyLib SHARED testclass1.h testclass.cpp)
+target_link_libraries(MyLib PRIVATE Qt6::Core MyInterfaceLib)
+target_compile_definitions(MyLib PRIVATE
+ -DMY_FIRST_DEF
+ MY_SECOND_DEF
+ -DMY_THIRD_DEF=1
+ MY_FOURTH_DEF=1
+)
+
+add_library(MyLib2 SHARED testclass1.h testclass.cpp)
+target_link_libraries(MyLib2 PRIVATE Qt6::Core)
+target_compile_definitions(MyLib2 PRIVATE
+ -DMY_FOREIGN_DEF
+)
+
+qt_manual_moc(moc_files testclass1.h TARGETS MyLib MyLib2)
+target_sources(MyLib PRIVATE ${moc_files})
+target_sources(MyLib2 PRIVATE ${moc_files})
+
+string(JOIN ";" expected
+ "MY_FIRST_DEF"
+ "MY_SECOND_DEF"
+ "MY_THIRD_DEF=1"
+ "MY_FOURTH_DEF=1"
+ "MY_TRANSITIVE_DEF=1"
+ "MY_FOREIGN_DEF"
+)
+
+add_custom_target(verify_testclass1 ALL COMMAND ${CMAKE_COMMAND}
+ "-DMOC_ARGS=moc_testclass1.cpp_parameters$<$<BOOL:$<CONFIG>>:_$<CONFIG>>"
+ "-DDEFINITIONS=${expected}"
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/VerifyDefines.cmake"
+ VERBATIM
+)
diff --git a/tests/auto/cmake/test_qt_manual_moc/VerifyDefines.cmake b/tests/auto/cmake/test_qt_manual_moc/VerifyDefines.cmake
new file mode 100644
index 0000000000..b3acedb014
--- /dev/null
+++ b/tests/auto/cmake/test_qt_manual_moc/VerifyDefines.cmake
@@ -0,0 +1,30 @@
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+
+if(NOT DEFINITIONS)
+ message(FATAL_ERROR "No definitions are provided to test")
+endif()
+
+if(NOT MOC_ARGS)
+ message(FATAL_ERROR "The moc RSP file is not specified")
+endif()
+
+file(READ "${MOC_ARGS}" moc_args_data)
+
+string(REPLACE "\n" ";" moc_args_data "${moc_args_data}")
+
+foreach(def IN LISTS DEFINITIONS)
+ set(found FALSE)
+ foreach(data IN LISTS moc_args_data)
+ if(data MATCHES "^(-D)?${def}")
+ set(found TRUE)
+ break()
+ endif()
+ endforeach()
+ if(NOT found)
+ message(FATAL_ERROR "The ${def} is missing in the moc argument list:\n${moc_args_data}")
+ endif()
+endforeach()
+
diff --git a/tests/auto/cmake/test_qt_manual_moc/testclass.cpp b/tests/auto/cmake/test_qt_manual_moc/testclass.cpp
new file mode 100644
index 0000000000..5323e18136
--- /dev/null
+++ b/tests/auto/cmake/test_qt_manual_moc/testclass.cpp
@@ -0,0 +1,8 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+#include "testclass.h"
+
+TestClass::TestClass(QObject *parent) : QObject(parent)
+{
+
+}
diff --git a/tests/auto/cmake/test_qt_manual_moc/testclass.h b/tests/auto/cmake/test_qt_manual_moc/testclass.h
new file mode 100644
index 0000000000..84fc656f1a
--- /dev/null
+++ b/tests/auto/cmake/test_qt_manual_moc/testclass.h
@@ -0,0 +1,17 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#ifndef TESTCLASS_H
+#define TESTCLASS_H
+
+#include <QObject>
+
+class TestClass : public QObject
+{
+ Q_OBJECT
+
+public:
+ TestClass(QObject *parent = nullptr);
+};
+
+#endif // TESTCLASS_H
diff --git a/tests/auto/cmake/test_qt_manual_moc/testclass1.h b/tests/auto/cmake/test_qt_manual_moc/testclass1.h
new file mode 100644
index 0000000000..84fc656f1a
--- /dev/null
+++ b/tests/auto/cmake/test_qt_manual_moc/testclass1.h
@@ -0,0 +1,17 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#ifndef TESTCLASS_H
+#define TESTCLASS_H
+
+#include <QObject>
+
+class TestClass : public QObject
+{
+ Q_OBJECT
+
+public:
+ TestClass(QObject *parent = nullptr);
+};
+
+#endif // TESTCLASS_H
diff --git a/tests/auto/cmake/test_qtmainwin_library/CMakeLists.txt b/tests/auto/cmake/test_qtmainwin_library/CMakeLists.txt
index 387fbd81f7..4719d9c332 100644
--- a/tests/auto/cmake/test_qtmainwin_library/CMakeLists.txt
+++ b/tests/auto/cmake/test_qtmainwin_library/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_qtmainwin_library/myobject.cpp b/tests/auto/cmake/test_qtmainwin_library/myobject.cpp
index 71d734f5fe..bb06a5bb8b 100644
--- a/tests/auto/cmake/test_qtmainwin_library/myobject.cpp
+++ b/tests/auto/cmake/test_qtmainwin_library/myobject.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "myobject.h"
diff --git a/tests/auto/cmake/test_qtmainwin_library/myobject.h b/tests/auto/cmake/test_qtmainwin_library/myobject.h
index ccf0a310ff..90bb75640f 100644
--- a/tests/auto/cmake/test_qtmainwin_library/myobject.h
+++ b/tests/auto/cmake/test_qtmainwin_library/myobject.h
@@ -1,5 +1,5 @@
// Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef MYOBJECT_H
#define MYOBJECT_H
diff --git a/tests/auto/cmake/test_resource_without_obj_lib/CMakeLists.txt b/tests/auto/cmake/test_resource_without_obj_lib/CMakeLists.txt
new file mode 100644
index 0000000000..16563141f4
--- /dev/null
+++ b/tests/auto/cmake/test_resource_without_obj_lib/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+
+project(test_resource_without_obj_lib)
+
+if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/FindPackageHints.cmake")
+ include("${CMAKE_CURRENT_LIST_DIR}/FindPackageHints.cmake")
+endif()
+
+find_package(Qt6 REQUIRED
+ COMPONENTS Core Test
+ HINTS ${Qt6Tests_PREFIX_PATH}
+)
+
+qt6_add_library(helper_lib STATIC helper_lib.cpp)
+qt6_add_resources(helper_lib "helper_res" FILES resource.txt PREFIX "/")
+
+# Link to Core, to ensure both the helper_lib and the main executable
+# inherit the QT_NAMESPACE if it is set, otherwise we get undefined
+# linker errors due to the mismatch in symbol names.
+target_link_libraries(helper_lib PRIVATE Qt6::Core)
+
+set(CMAKE_AUTOMOC ON)
+
+qt6_add_executable(test_resource_without_obj_lib main.cpp)
+target_link_libraries(test_resource_without_obj_lib PRIVATE Qt6::Core Qt6::Test)
+
+# Link against the library file and not the target, so that we can confirm
+# the ability to manually initialize the resource via Q_INIT_RESOURCE.
+target_link_libraries(test_resource_without_obj_lib PRIVATE $<TARGET_FILE:helper_lib>)
+
diff --git a/tests/auto/cmake/test_resource_without_obj_lib/helper_lib.cpp b/tests/auto/cmake/test_resource_without_obj_lib/helper_lib.cpp
new file mode 100644
index 0000000000..cd21e6c476
--- /dev/null
+++ b/tests/auto/cmake/test_resource_without_obj_lib/helper_lib.cpp
@@ -0,0 +1,4 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+void nothing() {}
diff --git a/tests/auto/cmake/test_resource_without_obj_lib/main.cpp b/tests/auto/cmake/test_resource_without_obj_lib/main.cpp
new file mode 100644
index 0000000000..bffbf81b87
--- /dev/null
+++ b/tests/auto/cmake/test_resource_without_obj_lib/main.cpp
@@ -0,0 +1,28 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include <QtCore/qtresource.h>
+#include <QtTest/QtTest>
+
+class TestManualResourceInit : public QObject
+{
+ Q_OBJECT
+private slots:
+ void initTestCase();
+ void resourceExistsAfterManualInit();
+};
+
+void TestManualResourceInit::initTestCase()
+{
+ // Manually initialize the resource like we used to do it in qt5 + qmake times.
+ Q_INIT_RESOURCE(helper_res);
+}
+
+void TestManualResourceInit::resourceExistsAfterManualInit()
+{
+ QVERIFY(QFile::exists(":/resource.txt"));
+}
+
+QTEST_MAIN(TestManualResourceInit)
+#include "main.moc"
+
diff --git a/tests/auto/cmake/test_resource_without_obj_lib/resource.txt b/tests/auto/cmake/test_resource_without_obj_lib/resource.txt
new file mode 100644
index 0000000000..7804a324a4
--- /dev/null
+++ b/tests/auto/cmake/test_resource_without_obj_lib/resource.txt
@@ -0,0 +1 @@
+Test resource
diff --git a/tests/auto/cmake/test_standalone_test/CMakeLists.txt b/tests/auto/cmake/test_standalone_test/CMakeLists.txt
new file mode 100644
index 0000000000..169d824c88
--- /dev/null
+++ b/tests/auto/cmake/test_standalone_test/CMakeLists.txt
@@ -0,0 +1,14 @@
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+project(tststandalone_test LANGUAGES CXX)
+find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+
+qt_internal_add_test(tst_standalone_test
+ GUI
+ SOURCES
+ tst_standalone_test.cpp
+ LIBRARIES
+ Qt::Gui
+)
diff --git a/tests/auto/cmake/test_standalone_test/tst_standalone_test.cpp b/tests/auto/cmake/test_standalone_test/tst_standalone_test.cpp
new file mode 100644
index 0000000000..fa533602ec
--- /dev/null
+++ b/tests/auto/cmake/test_standalone_test/tst_standalone_test.cpp
@@ -0,0 +1,22 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include <QTest>
+#include <QWindow>
+
+class tst_standalone_test : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void testLaunched()
+ {
+ QWindow w;
+ w.show();
+ QVERIFY(QTest::qWaitForWindowActive(&w));
+ }
+};
+
+QTEST_MAIN(tst_standalone_test)
+
+#include "tst_standalone_test.moc"
diff --git a/tests/auto/cmake/test_static_resources/.cmake.conf b/tests/auto/cmake/test_static_resources/.cmake.conf
index 377be0059e..10bc1fd407 100644
--- a/tests/auto/cmake/test_static_resources/.cmake.conf
+++ b/tests/auto/cmake/test_static_resources/.cmake.conf
@@ -1 +1 @@
-set(QT_REPO_MODULE_VERSION "6.5.0")
+set(QT_REPO_MODULE_VERSION "6.8.0")
diff --git a/tests/auto/cmake/test_static_resources/CMakeLists.txt b/tests/auto/cmake/test_static_resources/CMakeLists.txt
index b159f43b78..e3cab9cf4a 100644
--- a/tests/auto/cmake/test_static_resources/CMakeLists.txt
+++ b/tests/auto/cmake/test_static_resources/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
include(.cmake.conf)
@@ -10,6 +13,7 @@ project(TestStaticResources
)
find_package(Qt6 COMPONENTS Core BuildInternals Test CONFIG REQUIRED)
+qt_internal_project_setup()
qt_build_repo_begin()
@@ -18,4 +22,5 @@ add_subdirectory(mock_static_resources1)
add_subdirectory(test_init_resources_static_plugin)
add_subdirectory(test_static_resources_propagation)
+qt_build_repo_post_process()
qt_build_repo_end()
diff --git a/tests/auto/cmake/test_static_resources/mock_static_resources1/CMakeLists.txt b/tests/auto/cmake/test_static_resources/mock_static_resources1/CMakeLists.txt
index 973f8b3279..f866f0af46 100644
--- a/tests/auto/cmake/test_static_resources/mock_static_resources1/CMakeLists.txt
+++ b/tests/auto/cmake/test_static_resources/mock_static_resources1/CMakeLists.txt
@@ -1,4 +1,8 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
qt_internal_add_module(MockStaticResources1
+ NO_UNITY_BUILD
STATIC
PLUGIN_TYPES mockstaticresources
SOURCES
diff --git a/tests/auto/cmake/test_static_resources/mock_static_resources1/dummy.cpp b/tests/auto/cmake/test_static_resources/mock_static_resources1/dummy.cpp
index 31f62648f6..b6c23a82eb 100644
--- a/tests/auto/cmake/test_static_resources/mock_static_resources1/dummy.cpp
+++ b/tests/auto/cmake/test_static_resources/mock_static_resources1/dummy.cpp
@@ -1,4 +1,4 @@
// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
void dummy() { }
diff --git a/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/CMakeLists.txt b/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/CMakeLists.txt
index 99cb4a286e..dec5588a6d 100644
--- a/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/CMakeLists.txt
+++ b/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/CMakeLists.txt
@@ -1,4 +1,8 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
qt_internal_add_plugin(TestInitResourcesStaticPlugin STATIC
+ NO_UNITY_BUILD
OUTPUT_NAME
testinitresourcesstaticplugin
PLUGIN_TYPE mockstaticresources
diff --git a/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/pluginmain.cpp b/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/pluginmain.cpp
index da2ed67973..a95e54ee4f 100644
--- a/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/pluginmain.cpp
+++ b/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/pluginmain.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtCore/qfile.h>
#include <QtCore/qdebug.h>
diff --git a/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/test_init_resources_static_plugin.cpp b/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/test_init_resources_static_plugin.cpp
index 352ae57fac..2067b8c920 100644
--- a/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/test_init_resources_static_plugin.cpp
+++ b/tests/auto/cmake/test_static_resources/test_init_resources_static_plugin/test_init_resources_static_plugin.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtTest/QtTest>
#include <QtCore/qfile.h>
diff --git a/tests/auto/cmake/test_static_resources/test_static_resources_propagation/CMakeLists.txt b/tests/auto/cmake/test_static_resources/test_static_resources_propagation/CMakeLists.txt
index 44d4839084..b802323cfc 100644
--- a/tests/auto/cmake/test_static_resources/test_static_resources_propagation/CMakeLists.txt
+++ b/tests/auto/cmake/test_static_resources/test_static_resources_propagation/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
# TODO: Revisit which of these tests makes sense to keep now that we depend on CMake 3.21 to
# properly place object libraries object files on the link line.
# See QTBUG-95601
@@ -8,6 +11,7 @@
# Add a dummy library that links the static "Qt" module containing resources
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp" CONTENT "void dummy() { }")
add_library(dummy STATIC "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp")
+set_target_properties(dummy PROPERTIES UNITY_BUILD OFF)
target_link_libraries(dummy PRIVATE MockStaticResources1)
# Add the executable using qt_add_executable that needs to initialize the propagated resources.
@@ -16,6 +20,7 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.19)
qt_add_executable(test_static_resources_propagation main.cpp)
set_target_properties(test_static_resources_propagation PROPERTIES
AUTOMOC TRUE
+ UNITY_BUILD OFF
)
target_link_libraries(test_static_resources_propagation
PRIVATE
@@ -34,6 +39,7 @@ endif()
qt_add_executable(test_static_resources_propagation_manual_finalize main.cpp MANUAL_FINALIZATION)
set_target_properties(test_static_resources_propagation_manual_finalize PROPERTIES
AUTOMOC TRUE
+ UNITY_BUILD OFF
)
target_link_libraries(test_static_resources_propagation_manual_finalize
PRIVATE
@@ -51,6 +57,7 @@ add_test(NAME test_static_resources_propagation_manual_finalize
add_executable(test_static_resources_propagation_non_qt main.cpp)
set_target_properties(test_static_resources_propagation_non_qt PROPERTIES
AUTOMOC TRUE
+ UNITY_BUILD OFF
)
target_link_libraries(test_static_resources_propagation_non_qt
PRIVATE
@@ -73,6 +80,7 @@ if(NOT link_order_matters)
add_executable(test_static_resources_propagation_non_ld main.cpp)
set_target_properties(test_static_resources_propagation_non_ld PROPERTIES
AUTOMOC TRUE
+ UNITY_BUILD OFF
)
target_link_libraries(test_static_resources_propagation_non_ld
PRIVATE
@@ -120,6 +128,7 @@ if(POLICY CMP0099)
add_executable(test_static_resources_propagation_cmp0099_old_finalize main.cpp)
set_target_properties(test_static_resources_propagation_cmp0099_old_finalize PROPERTIES
AUTOMOC TRUE
+ UNITY_BUILD OFF
)
target_link_libraries(test_static_resources_propagation_cmp0099_old_finalize
PRIVATE
@@ -139,6 +148,7 @@ if(POLICY CMP0099)
add_executable(test_static_resources_propagation_cmp0099_new main.cpp)
set_target_properties(test_static_resources_propagation_cmp0099_new PROPERTIES
AUTOMOC TRUE
+ UNITY_BUILD OFF
)
target_link_libraries(test_static_resources_propagation_cmp0099_new
PRIVATE
@@ -154,6 +164,7 @@ if(POLICY CMP0099)
add_executable(test_static_resources_propagation_cmp0099_new_genex main.cpp)
set_target_properties(test_static_resources_propagation_cmp0099_new_genex PROPERTIES
AUTOMOC TRUE
+ UNITY_BUILD OFF
)
target_link_libraries(test_static_resources_propagation_cmp0099_new_genex
PRIVATE
diff --git a/tests/auto/cmake/test_static_resources/test_static_resources_propagation/main.cpp b/tests/auto/cmake/test_static_resources/test_static_resources_propagation/main.cpp
index fc048bb61e..c5d5312eb8 100644
--- a/tests/auto/cmake/test_static_resources/test_static_resources_propagation/main.cpp
+++ b/tests/auto/cmake/test_static_resources/test_static_resources_propagation/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtTest/QtTest>
#include <QtCore/qfile.h>
diff --git a/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt b/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt
index b6ac6434e8..3c83af7e0a 100644
--- a/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt
+++ b/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_testlib_definitions/core_only/CMakeLists.txt b/tests/auto/cmake/test_testlib_definitions/core_only/CMakeLists.txt
index cc68be18b8..872f291eeb 100644
--- a/tests/auto/cmake/test_testlib_definitions/core_only/CMakeLists.txt
+++ b/tests/auto/cmake/test_testlib_definitions/core_only/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
project(core_only)
diff --git a/tests/auto/cmake/test_testlib_definitions/gui/CMakeLists.txt b/tests/auto/cmake/test_testlib_definitions/gui/CMakeLists.txt
index 528ec7dc4e..737de2c95f 100644
--- a/tests/auto/cmake/test_testlib_definitions/gui/CMakeLists.txt
+++ b/tests/auto/cmake/test_testlib_definitions/gui/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
project(gui)
diff --git a/tests/auto/cmake/test_testlib_definitions/main.cpp b/tests/auto/cmake/test_testlib_definitions/main.cpp
index 750e42cfdf..9452adb817 100644
--- a/tests/auto/cmake/test_testlib_definitions/main.cpp
+++ b/tests/auto/cmake/test_testlib_definitions/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QObject>
#include <QTest>
diff --git a/tests/auto/cmake/test_testlib_definitions/widgets/CMakeLists.txt b/tests/auto/cmake/test_testlib_definitions/widgets/CMakeLists.txt
index 0dbf9139e6..5aae260fa8 100644
--- a/tests/auto/cmake/test_testlib_definitions/widgets/CMakeLists.txt
+++ b/tests/auto/cmake/test_testlib_definitions/widgets/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
project(widgets)
diff --git a/tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt b/tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt
index cc126ab87f..2515f61d05 100644
--- a/tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt
+++ b/tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt b/tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt
index b88ad60d44..89965032b2 100644
--- a/tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt
+++ b/tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_umbrella_config/CMakeLists.txt b/tests/auto/cmake/test_umbrella_config/CMakeLists.txt
index a7c31971fb..624374b8b2 100644
--- a/tests/auto/cmake/test_umbrella_config/CMakeLists.txt
+++ b/tests/auto/cmake/test_umbrella_config/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_umbrella_config/components_found/CMakeLists.txt b/tests/auto/cmake/test_umbrella_config/components_found/CMakeLists.txt
index 999aaccdd2..7341c9ab19 100644
--- a/tests/auto/cmake/test_umbrella_config/components_found/CMakeLists.txt
+++ b/tests/auto/cmake/test_umbrella_config/components_found/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
# The module finds its dependencies
find_package(Qt6 6.0.0
diff --git a/tests/auto/cmake/test_umbrella_config/components_not_found/CMakeLists.txt b/tests/auto/cmake/test_umbrella_config/components_not_found/CMakeLists.txt
index aa56559c8f..dee3edb3fd 100644
--- a/tests/auto/cmake/test_umbrella_config/components_not_found/CMakeLists.txt
+++ b/tests/auto/cmake/test_umbrella_config/components_not_found/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
# The module finds its dependencies
find_package(Qt6
diff --git a/tests/auto/cmake/test_versionless_targets/CMakeLists.txt b/tests/auto/cmake/test_versionless_targets/CMakeLists.txt
index 278586fb1d..1afcaa6a93 100644
--- a/tests/auto/cmake/test_versionless_targets/CMakeLists.txt
+++ b/tests/auto/cmake/test_versionless_targets/CMakeLists.txt
@@ -1,23 +1,103 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(versionless_targets)
-set(QT_NO_CREATE_VERSIONLESS_TARGETS ON)
+function(check_versionless_targets)
+ set(known_interface_properties
+ QT_MAJOR_VERSION
+ AUTOMOC_MACRO_NAMES
+ AUTOUIC_OPTIONS
+ COMPILE_DEFINITIONS
+ COMPILE_FEATURES
+ COMPILE_OPTIONS
+ CXX_MODULE_SETS
+ HEADER_SETS
+ HEADER_SETS_TO_VERIFY
+ INCLUDE_DIRECTORIES
+ LINK_DEPENDS
+ LINK_DIRECTORIES
+ LINK_LIBRARIES
+ LINK_LIBRARIES_DIRECT
+ LINK_LIBRARIES_DIRECT_EXCLUDE
+ LINK_OPTIONS
+ POSITION_INDEPENDENT_CODE
+ PRECOMPILE_HEADERS
+ SOURCES
+ SYSTEM_INCLUDE_DIRECTORIES
+ )
+
+ set(known_qt_exported_properties
+ MODULE_PLUGIN_TYPES
+ QT_DISABLED_PRIVATE_FEATURES
+ QT_DISABLED_PUBLIC_FEATURES
+ QT_ENABLED_PRIVATE_FEATURES
+ QT_ENABLED_PUBLIC_FEATURES
+ QT_QMAKE_PRIVATE_CONFIG
+ QT_QMAKE_PUBLIC_CONFIG
+ QT_QMAKE_PUBLIC_QT_CONFIG
+ _qt_config_module_name
+ _qt_is_public_module
+ _qt_module_has_headers
+ _qt_module_has_private_headers
+ _qt_module_has_public_headers
+ _qt_module_has_qpa_headers
+ _qt_module_has_rhi_headers
+ _qt_module_include_name
+ _qt_module_interface_name
+ _qt_package_name
+ _qt_package_version
+ _qt_private_module_target_name
+ )
-find_package(Qt6Core REQUIRED)
+ foreach(prop ${known_interface_properties})
+ set(versionless_prop "")
+ set(versioned_prop "")
+ get_target_property(versionless_prop Qt::Core INTERFACE_${prop})
+ get_target_property(versioned_prop Qt6::Core INTERFACE_${prop})
+ if(NOT versionless_prop AND NOT versioned_prop)
+ continue()
+ endif()
-if (NOT TARGET Qt6::Core)
- message(SEND_ERROR "Qt6::Core target not defined!")
-endif()
+ if(NOT "${versionless_prop}" STREQUAL "${versioned_prop}")
+ message(SEND_ERROR "INTERFACE_${prop} doesn't match versionless ${versionless_prop}"
+ " versioned ${versioned_prop}")
+ endif()
+ endforeach()
-if (TARGET Qt::Core)
- message(SEND_ERROR "Qt::Core target defined despite QT_NO_CREATE_VERSIONLESS_TARGETS!")
-endif()
+ foreach(prop ${known_qt_exported_properties})
+ set(versionless_prop "")
+ set(versioned_prop "")
+ get_target_property(versionless_prop Qt::Core ${prop})
+ get_target_property(versioned_prop Qt6::Core ${prop})
+ if(NOT versionless_prop AND NOT versioned_prop)
+ continue()
+ endif()
-set(QT_NO_CREATE_VERSIONLESS_TARGETS OFF)
+ if(NOT "${versionless_prop}" STREQUAL "${versioned_prop}")
+ message(SEND_ERROR "${prop} doesn't match versionless ${versionless_prop}"
+ " versioned ${versioned_prop}")
+ endif()
+ endforeach()
-find_package(Qt6Core REQUIRED)
+ foreach(conf "" _RELEASE _DEBUG _RELWITHDEBINFO _MINSIZEREL)
+ set(versionless_prop "")
+ set(versioned_prop "")
+ get_target_property(versionless_prop Qt::Core IMPORTED_LOCATION${conf})
+ get_target_property(versioned_prop Qt6::Core IMPORTED_LOCATION${conf})
+ if(NOT versionless_prop AND NOT versioned_prop)
+ continue()
+ endif()
+ if(NOT "${versionless_prop}" STREQUAL "${versioned_prop}")
+ message(SEND_ERROR "IMPORTED_LOCATION${conf} doesn't match versionless ${versionless_prop}"
+ " versioned ${versioned_prop}")
+ endif()
+ endforeach()
+endfunction()
-if (NOT TARGET Qt::Core)
- message(SEND_ERROR "Qt::Core target not defined!")
-endif()
+add_subdirectory(default)
+add_subdirectory(force_off)
+add_subdirectory(force_on)
+add_subdirectory(force_old)
diff --git a/tests/auto/cmake/test_versionless_targets/default/CMakeLists.txt b/tests/auto/cmake/test_versionless_targets/default/CMakeLists.txt
new file mode 100644
index 0000000000..a8757607cf
--- /dev/null
+++ b/tests/auto/cmake/test_versionless_targets/default/CMakeLists.txt
@@ -0,0 +1,17 @@
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+
+message("Test default creating of versionless targets")
+find_package(Qt6Core REQUIRED)
+
+if(NOT TARGET Qt6::Core)
+ message(SEND_ERROR "Qt6::Core target not defined!")
+endif()
+
+if(NOT TARGET Qt::Core)
+ message(SEND_ERROR "Qt::Core target not defined!")
+endif()
+
+check_versionless_targets()
diff --git a/tests/auto/cmake/test_versionless_targets/force_off/CMakeLists.txt b/tests/auto/cmake/test_versionless_targets/force_off/CMakeLists.txt
new file mode 100644
index 0000000000..247b1b8c27
--- /dev/null
+++ b/tests/auto/cmake/test_versionless_targets/force_off/CMakeLists.txt
@@ -0,0 +1,18 @@
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+
+message("Test disabled versionless targets")
+
+set(QT_NO_CREATE_VERSIONLESS_TARGETS ON)
+
+find_package(Qt6Core REQUIRED)
+
+if(NOT TARGET Qt6::Core)
+ message(SEND_ERROR "Qt6::Core target not defined!")
+endif()
+
+if(TARGET Qt::Core)
+ message(SEND_ERROR "Qt::Core target defined despite QT_NO_CREATE_VERSIONLESS_TARGETS!")
+endif()
diff --git a/tests/auto/cmake/test_versionless_targets/force_old/CMakeLists.txt b/tests/auto/cmake/test_versionless_targets/force_old/CMakeLists.txt
new file mode 100644
index 0000000000..9e83fec7b3
--- /dev/null
+++ b/tests/auto/cmake/test_versionless_targets/force_old/CMakeLists.txt
@@ -0,0 +1,21 @@
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+
+message("Test force old versionless targets")
+
+set(QT_USE_OLD_VERSION_LESS_TARGETS ON)
+
+find_package(Qt6Core REQUIRED)
+
+if(NOT TARGET Qt6::Core)
+ message(SEND_ERROR "Qt6::Core target not defined!")
+endif()
+
+if(NOT TARGET Qt::Core)
+ message(SEND_ERROR "Qt::Core target not defined!")
+endif()
+
+check_versionless_targets()
+
diff --git a/tests/auto/cmake/test_versionless_targets/force_on/CMakeLists.txt b/tests/auto/cmake/test_versionless_targets/force_on/CMakeLists.txt
new file mode 100644
index 0000000000..b3d7596143
--- /dev/null
+++ b/tests/auto/cmake/test_versionless_targets/force_on/CMakeLists.txt
@@ -0,0 +1,20 @@
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+
+message("Test enabled versionless targets")
+
+set(QT_NO_CREATE_VERSIONLESS_TARGETS OFF)
+
+find_package(Qt6Core REQUIRED)
+
+if(NOT TARGET Qt6::Core)
+ message(SEND_ERROR "Qt6::Core target not defined!")
+endif()
+
+if(NOT TARGET Qt::Core)
+ message(SEND_ERROR "Qt::Core target not defined!")
+endif()
+
+check_versionless_targets()
diff --git a/tests/auto/cmake/test_widgets_app_deployment/CMakeLists.txt b/tests/auto/cmake/test_widgets_app_deployment/CMakeLists.txt
index aa30954f45..9457278e12 100644
--- a/tests/auto/cmake/test_widgets_app_deployment/CMakeLists.txt
+++ b/tests/auto/cmake/test_widgets_app_deployment/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
project(deployment_api)
enable_testing()
@@ -9,7 +12,12 @@ qt6_standard_project_setup()
function(create_test_executable target)
cmake_parse_arguments(arg "" "" "" ${ARGN})
- qt_add_executable(${target} main.cpp)
+ if(CMAKE_VERSION VERSION_LESS "3.19")
+ qt_add_executable(${target} MANUAL_FINALIZATION main.cpp)
+ else()
+ qt_add_executable(${target} main.cpp)
+ endif()
+
set_target_properties(${target} PROPERTIES
# We explicitly don't set WIN32_EXECUTABLE to ensure we see errors from stderr when
# something fails and not having to use DebugView.
@@ -25,16 +33,22 @@ function(create_test_executable target)
qt_generate_deploy_app_script(
TARGET ${target}
- FILENAME_VARIABLE deploy_script
+ OUTPUT_SCRIPT deploy_script
# Don't fail at configure time on unsupported platforms
NO_UNSUPPORTED_PLATFORM_ERROR
)
install(SCRIPT ${deploy_script})
+ if(CMAKE_VERSION VERSION_LESS "3.19")
+ qt_finalize_target(${target})
+ endif()
+
if(APPLE AND NOT IOS)
set(installed_app_location "${CMAKE_INSTALL_PREFIX}/${target}.app/Contents/MacOS/${target}")
elseif(WIN32)
set(installed_app_location "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/${target}.exe")
+ elseif(UNIX AND NOT APPLE AND NOT ANDROID AND NOT CMAKE_CROSSCOMPILING)
+ set(installed_app_location "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/${target}")
endif()
# There's no nice way to get the location of an installed binary, so we need to construct
diff --git a/tests/auto/cmake/test_widgets_app_deployment/main.cpp b/tests/auto/cmake/test_widgets_app_deployment/main.cpp
index 1823a50169..939cd72380 100644
--- a/tests/auto/cmake/test_widgets_app_deployment/main.cpp
+++ b/tests/auto/cmake/test_widgets_app_deployment/main.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2022 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtTest>
#include <QMainWindow>
diff --git a/tests/auto/cmake/test_wrap_cpp_and_resources/CMakeLists.txt b/tests/auto/cmake/test_wrap_cpp_and_resources/CMakeLists.txt
index 8452bf8c91..da413168ff 100644
--- a/tests/auto/cmake/test_wrap_cpp_and_resources/CMakeLists.txt
+++ b/tests/auto/cmake/test_wrap_cpp_and_resources/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_wrap_cpp_and_resources/myobject.cpp b/tests/auto/cmake/test_wrap_cpp_and_resources/myobject.cpp
index 8330e3250d..3adda87348 100644
--- a/tests/auto/cmake/test_wrap_cpp_and_resources/myobject.cpp
+++ b/tests/auto/cmake/test_wrap_cpp_and_resources/myobject.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "myobject.h"
diff --git a/tests/auto/cmake/test_wrap_cpp_and_resources/myobject.h b/tests/auto/cmake/test_wrap_cpp_and_resources/myobject.h
index 917ae9fd24..87d7bfa3df 100644
--- a/tests/auto/cmake/test_wrap_cpp_and_resources/myobject.h
+++ b/tests/auto/cmake/test_wrap_cpp_and_resources/myobject.h
@@ -1,5 +1,5 @@
// Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef MYOBJECT_H
#define MYOBJECT_H
diff --git a/tests/auto/cmake/test_wrap_cpp_moc/CMakeLists.txt b/tests/auto/cmake/test_wrap_cpp_moc/CMakeLists.txt
new file mode 100644
index 0000000000..c00a9d83c5
--- /dev/null
+++ b/tests/auto/cmake/test_wrap_cpp_moc/CMakeLists.txt
@@ -0,0 +1,19 @@
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+
+project(test_wrap_cpp_and_resources)
+
+find_package(Qt6Core REQUIRED)
+
+add_executable(example main.cpp)
+
+qt_wrap_cpp(moc_files main.cpp TARGET example)
+
+# expect the generated moc files to be empty when a source file is passed
+if (NOT moc_files STREQUAL "")
+ message(FATAL_ERROR "test_qt_wrap_cpp_moc: moc_files should be empty")
+endif()
+
+target_link_libraries(example PRIVATE Qt::Core)
diff --git a/tests/auto/cmake/test_wrap_cpp_moc/main.cpp b/tests/auto/cmake/test_wrap_cpp_moc/main.cpp
new file mode 100644
index 0000000000..28ebfe0536
--- /dev/null
+++ b/tests/auto/cmake/test_wrap_cpp_moc/main.cpp
@@ -0,0 +1,17 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include <QObject>
+
+class MyObject2 : public QObject {
+ Q_OBJECT
+public:
+ MyObject2() = default;
+};
+
+#include "main.moc"
+
+int main()
+{
+ return 0;
+}
diff --git a/tests/auto/cmake/test_wrap_cpp_options/CMakeLists.txt b/tests/auto/cmake/test_wrap_cpp_options/CMakeLists.txt
index 17f8fd7a48..80f4992da7 100644
--- a/tests/auto/cmake/test_wrap_cpp_options/CMakeLists.txt
+++ b/tests/auto/cmake/test_wrap_cpp_options/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
cmake_minimum_required(VERSION 3.16)
diff --git a/tests/auto/cmake/test_wrap_cpp_options/myobject.cpp b/tests/auto/cmake/test_wrap_cpp_options/myobject.cpp
index 2a90499e6a..14e00e789a 100644
--- a/tests/auto/cmake/test_wrap_cpp_options/myobject.cpp
+++ b/tests/auto/cmake/test_wrap_cpp_options/myobject.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "myobject.h"
diff --git a/tests/auto/cmake/test_wrap_cpp_options/myobject.h b/tests/auto/cmake/test_wrap_cpp_options/myobject.h
index 917ae9fd24..87d7bfa3df 100644
--- a/tests/auto/cmake/test_wrap_cpp_options/myobject.h
+++ b/tests/auto/cmake/test_wrap_cpp_options/myobject.h
@@ -1,5 +1,5 @@
// Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef MYOBJECT_H
#define MYOBJECT_H
diff --git a/tests/auto/cmake/tst_qaddpreroutine/CMakeLists.txt b/tests/auto/cmake/tst_qaddpreroutine/CMakeLists.txt
index 96cd293c6f..bc1a6339db 100644
--- a/tests/auto/cmake/tst_qaddpreroutine/CMakeLists.txt
+++ b/tests/auto/cmake/tst_qaddpreroutine/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
#####################################################################
## tst_qaddpreroutine Test:
#####################################################################
@@ -22,6 +25,7 @@ qt_prepare_standalone_project()
find_package(Qt6 COMPONENTS Gui Test CONFIG REQUIRED)
qt_internal_add_plugin(QTBUG_90341ThemePlugin
+ NO_UNITY_BUILD
OUTPUT_NAME QTBUG_90341
OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
CLASS_NAME ThemePlugin
diff --git a/tests/auto/cmake/tst_qaddpreroutine/plugin.cpp b/tests/auto/cmake/tst_qaddpreroutine/plugin.cpp
index ccb0096730..1647d8d3a8 100644
--- a/tests/auto/cmake/tst_qaddpreroutine/plugin.cpp
+++ b/tests/auto/cmake/tst_qaddpreroutine/plugin.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2021 zccrs <zccrs@live.com>, JiDe Zhang <zhangjide@uniontech.com>.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qpa/qplatformthemeplugin.h>
#include <qpa/qplatformtheme.h>
diff --git a/tests/auto/cmake/tst_qaddpreroutine/tst_qaddpreroutine.cpp b/tests/auto/cmake/tst_qaddpreroutine/tst_qaddpreroutine.cpp
index 42c7a07b08..21394648c0 100644
--- a/tests/auto/cmake/tst_qaddpreroutine/tst_qaddpreroutine.cpp
+++ b/tests/auto/cmake/tst_qaddpreroutine/tst_qaddpreroutine.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2021 zccrs <zccrs@live.com>, JiDe Zhang <zhangjide@uniontech.com>.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QTest>
#include <QGuiApplication>