summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindWrapBrotli.cmake7
-rw-r--r--cmake/FindWrapSystemHarfbuzz.cmake7
-rw-r--r--cmake/FindWrapSystemPCRE2.cmake7
-rw-r--r--cmake/FindWrapSystemZLIB.cmake10
-rw-r--r--cmake/FindWrapZSTD.cmake7
-rw-r--r--cmake/QtExecutableHelpers.cmake97
-rw-r--r--cmake/QtHeadersClean.cmake4
-rw-r--r--cmake/QtPkgConfigHelpers.cmake2
-rw-r--r--cmake/QtPluginHelpers.cmake108
-rw-r--r--cmake/QtPostProcessHelpers.cmake10
-rw-r--r--cmake/QtProcessConfigureArgs.cmake9
-rw-r--r--cmake/QtPublicWalkLibsHelpers.cmake14
-rw-r--r--cmake/QtPublicWasmToolchainHelpers.cmake4
-rw-r--r--cmake/QtTargetHelpers.cmake17
-rw-r--r--cmake/QtTestHelpers.cmake8
-rw-r--r--cmake/configure-cmake-mapping.md5
-rw-r--r--cmake/visionos/Info.plist.app.in8
17 files changed, 142 insertions, 182 deletions
diff --git a/cmake/FindWrapBrotli.cmake b/cmake/FindWrapBrotli.cmake
index e2d7b564f6..d254f4292e 100644
--- a/cmake/FindWrapBrotli.cmake
+++ b/cmake/FindWrapBrotli.cmake
@@ -20,6 +20,13 @@ if (unofficial-brotli_FOUND)
set(WrapBrotli_FOUND ON)
else()
+ get_cmake_property(__packages_not_found PACKAGES_NOT_FOUND)
+ if(__packages_not_found)
+ list(REMOVE_ITEM __packages_not_found unofficial-brotli)
+ set_property(GLOBAL PROPERTY PACKAGES_NOT_FOUND "${__packages_not_found}")
+ endif()
+ unset(__packages_not_found)
+
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(libbrotlidec QUIET IMPORTED_TARGET "libbrotlidec")
diff --git a/cmake/FindWrapSystemHarfbuzz.cmake b/cmake/FindWrapSystemHarfbuzz.cmake
index 07b3405bc0..d989c93e44 100644
--- a/cmake/FindWrapSystemHarfbuzz.cmake
+++ b/cmake/FindWrapSystemHarfbuzz.cmake
@@ -28,6 +28,13 @@ if(harfbuzz_FOUND AND TARGET "${__harfbuzz_target_name}")
if(harfbuzz_VERSION)
set(WrapSystemHarfbuzz_VERSION "${harfbuzz_VERSION}")
endif()
+else()
+ get_cmake_property(__packages_not_found PACKAGES_NOT_FOUND)
+ if(__packages_not_found)
+ list(REMOVE_ITEM __packages_not_found harfbuzz)
+ set_property(GLOBAL PROPERTY PACKAGES_NOT_FOUND "${__packages_not_found}")
+ endif()
+ unset(__packages_not_found)
endif()
if(__harfbuzz_broken_config_file OR NOT __harfbuzz_found)
diff --git a/cmake/FindWrapSystemPCRE2.cmake b/cmake/FindWrapSystemPCRE2.cmake
index 61e0d2fb5b..ce00252c8c 100644
--- a/cmake/FindWrapSystemPCRE2.cmake
+++ b/cmake/FindWrapSystemPCRE2.cmake
@@ -16,6 +16,13 @@ if(PCRE2_FOUND AND TARGET "${__pcre2_target_name}")
if(PCRE2_VERSION)
set(WrapSystemPCRE2_VERSION "${PCRE2_VERSION}")
endif()
+else()
+ get_cmake_property(__packages_not_found PACKAGES_NOT_FOUND)
+ if(__packages_not_found)
+ list(REMOVE_ITEM __packages_not_found PCRE2)
+ set_property(GLOBAL PROPERTY PACKAGES_NOT_FOUND "${__packages_not_found}")
+ endif()
+ unset(__packages_not_found)
endif()
if(NOT __pcre2_found)
diff --git a/cmake/FindWrapSystemZLIB.cmake b/cmake/FindWrapSystemZLIB.cmake
index 5db43db626..f9a8f004ec 100644
--- a/cmake/FindWrapSystemZLIB.cmake
+++ b/cmake/FindWrapSystemZLIB.cmake
@@ -28,5 +28,13 @@ if(ZLIB_FOUND)
endif()
endif()
+if(ZLIB_VERSION)
+ set(WrapSystemZLIB_VERSION "${ZLIB_VERSION}")
+elseif(ZLIB_VERSION_STRING)
+ set(WrapSystemZLIB_VERSION "${ZLIB_VERSION_STRING}")
+endif()
+
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(WrapSystemZLIB DEFAULT_MSG WrapSystemZLIB_FOUND)
+find_package_handle_standard_args(WrapSystemZLIB
+ REQUIRED_VARS WrapSystemZLIB_FOUND
+ VERSION_VAR WrapSystemZLIB_VERSION)
diff --git a/cmake/FindWrapZSTD.cmake b/cmake/FindWrapZSTD.cmake
index fb424236b8..7e5adcf276 100644
--- a/cmake/FindWrapZSTD.cmake
+++ b/cmake/FindWrapZSTD.cmake
@@ -39,6 +39,13 @@ if(TARGET zstd::libzstd_static OR TARGET zstd::libzstd_shared)
INTERFACE_LINK_LIBRARIES "zstd::libzstd${zstdtargetsuffix}")
endif()
else()
+ get_cmake_property(__packages_not_found PACKAGES_NOT_FOUND)
+ if(__packages_not_found)
+ list(REMOVE_ITEM __packages_not_found zstd)
+ set_property(GLOBAL PROPERTY PACKAGES_NOT_FOUND "${__packages_not_found}")
+ endif()
+ unset(__packages_not_found)
+
find_package(PkgConfig QUIET)
pkg_check_modules(PC_ZSTD QUIET "libzstd")
diff --git a/cmake/QtExecutableHelpers.cmake b/cmake/QtExecutableHelpers.cmake
index fb96ca4db2..7856e4111f 100644
--- a/cmake/QtExecutableHelpers.cmake
+++ b/cmake/QtExecutableHelpers.cmake
@@ -207,103 +207,6 @@ function(qt_internal_add_executable name)
ADDITIONAL_INSTALL_ARGS ${additional_install_args})
qt_internal_install_pdb_files(${name} "${arg_INSTALL_DIRECTORY}")
endif()
-
- # If linking against Gui, make sure to also build the default QPA plugin.
- # This makes the experience of an initial Qt configuration to build and run one single
- # test / executable nicer.
- get_target_property(linked_libs "${name}" LINK_LIBRARIES)
- if("Qt::Gui" IN_LIST linked_libs AND TARGET qpa_default_plugins)
- add_dependencies("${name}" qpa_default_plugins)
- endif()
-
- # For static plugins, we need to explicitly link to plugins we want to be
- # loaded with the executable. User projects get that automatically, but
- # for tools built as part of Qt, we can't use that mechanism because it
- # would pollute the targets we export as part of an install and lead to
- # circular dependencies. The logic here is a simpler equivalent of the
- # more dynamic logic in QtPlugins.cmake.in, but restricted to only
- # adding plugins that are provided by the same module as the module
- # libraries the executable links to.
- set(libs
- ${arg_LIBRARIES}
- ${arg_PUBLIC_LIBRARIES}
- ${extra_libraries}
- Qt::PlatformCommonInternal
- )
-
- set(deduped_libs "")
- foreach(lib IN LISTS libs)
- if(NOT TARGET "${lib}")
- continue()
- endif()
-
- # Normalize module by stripping any leading "Qt::", because properties are set on the
- # versioned target (either Gui when building the module, or Qt6::Gui when it's
- # imported).
- if(lib MATCHES "Qt::([-_A-Za-z0-9]+)")
- set(new_lib "${QT_CMAKE_EXPORT_NAMESPACE}::${CMAKE_MATCH_1}")
- if(TARGET "${new_lib}")
- set(lib "${new_lib}")
- endif()
- endif()
-
- # Unalias the target.
- get_target_property(aliased_target ${lib} ALIASED_TARGET)
- if(aliased_target)
- set(lib ${aliased_target})
- endif()
-
- list(APPEND deduped_libs "${lib}")
- endforeach()
-
- list(REMOVE_DUPLICATES deduped_libs)
-
- foreach(lib IN LISTS deduped_libs)
- string(MAKE_C_IDENTIFIER "${name}_plugin_imports_${lib}" out_file)
- string(APPEND out_file .cpp)
-
- # Initialize plugins that are built in the same repository as the Qt module 'lib'.
- set(class_names_regular
- "$<GENEX_EVAL:$<TARGET_PROPERTY:${lib},_qt_initial_repo_plugin_class_names>>")
-
- # Initialize plugins that are built in the current Qt repository, but are associated
- # with a Qt module from a different repository (qtsvg's QSvgPlugin associated with
- # qtbase's QtGui).
- string(MAKE_C_IDENTIFIER "${PROJECT_NAME}" current_project_name)
- set(prop_prefix "_qt_repo_${current_project_name}")
- set(class_names_current_project
- "$<GENEX_EVAL:$<TARGET_PROPERTY:${lib},${prop_prefix}_plugin_class_names>>")
-
- # Only add separator if first list is not empty, so we don't trigger the file generation
- # when all lists are empty.
- set(class_names_separator "$<$<NOT:$<STREQUAL:${class_names_regular},>>:;>" )
- set(class_names
- "${class_names_regular}${class_names_separator}${class_names_current_project}")
-
- set(out_file_path "${CMAKE_CURRENT_BINARY_DIR}/${out_file}")
-
- file(GENERATE OUTPUT "${out_file_path}" CONTENT
-"// This file is auto-generated. Do not edit.
-#include <QtPlugin>
-
-Q_IMPORT_PLUGIN($<JOIN:${class_names},)\nQ_IMPORT_PLUGIN(>)
-"
- CONDITION "$<NOT:$<STREQUAL:${class_names},>>"
- )
-
- # CMake versions earlier than 3.18.0 can't find the generated file for some reason,
- # failing at generation phase.
- # Explicitly marking the file as GENERATED fixes the issue.
- set_source_files_properties("${out_file_path}" PROPERTIES GENERATED TRUE)
-
- target_sources(${name} PRIVATE
- "$<$<NOT:$<STREQUAL:${class_names},>>:${out_file_path}>"
- )
- target_link_libraries(${name} PRIVATE
- "$<TARGET_PROPERTY:${lib},_qt_initial_repo_plugins>"
- "$<TARGET_PROPERTY:${lib},${prop_prefix}_plugins>")
- endforeach()
-
endfunction()
# This function compiles the target at configure time the very first time and creates the custom
diff --git a/cmake/QtHeadersClean.cmake b/cmake/QtHeadersClean.cmake
index f47ac1754c..a1ebfcef28 100644
--- a/cmake/QtHeadersClean.cmake
+++ b/cmake/QtHeadersClean.cmake
@@ -112,6 +112,7 @@ function(qt_internal_add_headersclean_target module_target module_headers)
-Woverloaded-virtual -Wshadow -Wundef -Wfloat-equal
-Wnon-virtual-dtor -Wpointer-arith -Wformat-security
-Wchar-subscripts -Wold-style-cast
+ -Wredundant-decls # QTBUG-115583
-fno-operator-names)
if(QT_FEATURE_reduce_relocations AND UNIX)
@@ -129,7 +130,8 @@ function(qt_internal_add_headersclean_target module_target module_headers)
endif()
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang|IntelLLVM")
- list(APPEND hcleanFLAGS -Wshorten-64-to-32)
+ list(APPEND hcleanFLAGS -Wshorten-64-to-32
+ -Wweak-vtables)
endif()
separate_arguments(cxx_flags NATIVE_COMMAND ${CMAKE_CXX_FLAGS})
diff --git a/cmake/QtPkgConfigHelpers.cmake b/cmake/QtPkgConfigHelpers.cmake
index dbe736c438..ea28516941 100644
--- a/cmake/QtPkgConfigHelpers.cmake
+++ b/cmake/QtPkgConfigHelpers.cmake
@@ -74,7 +74,7 @@ function(qt_internal_generate_pkg_config_file module)
foreach(dep IN LISTS loose_target_requires)
if(dep MATCHES "^Qt::")
string(REGEX REPLACE "Qt" "${QT_CMAKE_EXPORT_NAMESPACE}" dep ${dep})
- else()
+ elseif(NOT dep MATCHES "^${QT_CMAKE_EXPORT_NAMESPACE}::")
# TODO: Figure out a way to get non-Qt requirements PkgConfig files.
continue()
endif()
diff --git a/cmake/QtPluginHelpers.cmake b/cmake/QtPluginHelpers.cmake
index 9437d4236d..787788c9a9 100644
--- a/cmake/QtPluginHelpers.cmake
+++ b/cmake/QtPluginHelpers.cmake
@@ -227,69 +227,6 @@ function(qt_internal_add_plugin target)
set(plugin_target_versioned "${QT_CMAKE_EXPORT_NAMESPACE}::${target}")
get_target_property(type "${plugin_target_versioned}" TYPE)
- if(type STREQUAL STATIC_LIBRARY)
- # Associate plugin with its Qt module when both are both built in the same repository.
- # Check that by comparing the PROJECT_NAME of each.
- # This covers auto-linking of the majority of plugins to executables and in-tree tests.
- # Linking of plugins in standalone tests (when the Qt module will be an imported target)
- # is handled instead by the complicated genex logic in QtModulePlugins.cmake.in.
- set(is_plugin_and_module_in_same_project FALSE)
- if(NOT is_imported_qt_module)
- get_target_property(module_source_dir ${qt_module_target} SOURCE_DIR)
- get_directory_property(module_project_name
- DIRECTORY ${module_source_dir}
- DEFINITION PROJECT_NAME
- )
- if(module_project_name STREQUAL PROJECT_NAME)
- set(is_plugin_and_module_in_same_project TRUE)
- endif()
-
- # When linking static plugins with the special logic in qt_internal_add_executable,
- # make sure to skip non-default plugins.
- if(is_plugin_and_module_in_same_project AND _default_plugin)
- set_property(TARGET ${qt_module_target} APPEND PROPERTY
- _qt_initial_repo_plugins
- "${target}")
- set_property(TARGET ${qt_module_target} APPEND PROPERTY
- _qt_initial_repo_plugin_class_names
- "$<TARGET_PROPERTY:${target},QT_PLUGIN_CLASS_NAME>"
- )
- endif()
- endif()
-
- # Associate plugin with its Qt module when the plugin is built in the current repository
- # but the module is built in a different repository (qtsvg's QSvgPlugin associated with
- # qtbase's QtGui).
- # The association is done in a separate property, to ensure that reconfiguring in-tree tests
- # in qtbase doesn't accidentally cause linking to a plugin from a previously built qtsvg.
- # Needed for in-tree tests like in qtsvg, qtimageformats.
- # This is done for each Qt module regardless if it's an imported target or not, to handle
- # both per-repo and top-level builds (in per-repo build of qtsvg QtGui is imported, in a
- # top-level build Gui is not imported, but in both cases qtsvg tests need to link to
- # QSvgPlugin).
- #
- # TODO: Top-level in-tree tests and qdeclarative per-repo in-tree tests that depend on
- # static Qml plugins won't work due to the requirement of running qmlimportscanner
- # at configure time, but qmlimportscanner is not built at that point. Moving the
- # execution of qmlimportscanner to build time is non-trivial because qmlimportscanner
- # not only generates a cpp file to compile but also outputs a list of static plugins
- # that should be linked and there is no straightforward way to tell CMake to link
- # against a list of libraries that was discovered at build time (apart from
- # response files, which apparently might not work on all platforms).
- # qmake doesn't have this problem because each project is configured separately so
- # qmlimportscanner is always built by the time it needs to be run for a test.
- if(NOT is_plugin_and_module_in_same_project AND _default_plugin)
- string(MAKE_C_IDENTIFIER "${PROJECT_NAME}" current_project_name)
- set(prop_prefix "_qt_repo_${current_project_name}")
- set_property(TARGET ${qt_module_target} APPEND PROPERTY
- ${prop_prefix}_plugins "${target}")
- set_property(TARGET ${qt_module_target} APPEND PROPERTY
- ${prop_prefix}_plugin_class_names
- "$<TARGET_PROPERTY:${target},QT_PLUGIN_CLASS_NAME>"
- )
- endif()
- endif()
-
qt_internal_add_autogen_sync_header_dependencies(${target} ${qt_module_target})
endif()
@@ -623,3 +560,48 @@ function(qt_internal_add_darwin_permission_plugin permission)
QT_PLUGIN_PRI_EXTRA_CONTENT ${extra_plugin_pri_content}
)
endfunction()
+
+# The function looks and links the static plugins that the target depends on. The function behaves
+# similar to qt_import_plugins, but should be used when building Qt executable or shared libraries.
+# It's expected that all dependencies are valid targets at the time when the function is called.
+# If not their plugins will be not collected for linking.
+function(qt_internal_import_plugins target)
+ set(plugin_targets "")
+ foreach(dep_target IN LISTS ARGN)
+ if(dep_target AND TARGET ${dep_target})
+ get_target_property(plugins ${dep_target} _qt_plugins)
+ if(plugins)
+ list(APPEND plugin_targets ${plugins})
+ else()
+ # Fallback should be remove in Qt 7.
+ get_target_property(target_type ${dep_target} TYPE)
+ if(NOT "${target_type}" STREQUAL "INTERFACE_LIBRARY")
+ get_target_property(plugins ${dep_target} QT_PLUGINS)
+ if(plugins)
+ list(APPEND plugin_targets ${plugins})
+ endif()
+ endif()
+ endif()
+ endif()
+ endforeach()
+
+ set(non_imported_plugin_targets "")
+ foreach(plugin_target IN LISTS plugin_targets)
+ if(NOT TARGET ${plugin_target} OR "${plugin_target}" IN_LIST non_imported_plugin_targets)
+ continue()
+ endif()
+
+ get_target_property(is_imported ${plugin_target} IMPORTED)
+ if(NOT is_imported)
+ list(APPEND non_imported_plugin_targets "${plugin_target}")
+ endif()
+ endforeach()
+
+ if(plugin_targets)
+ __qt_internal_collect_plugin_init_libraries("${non_imported_plugin_targets}" init_libraries)
+ __qt_internal_collect_plugin_libraries("${non_imported_plugin_targets}" plugin_libraries)
+ if(plugin_libraries OR init_libraries)
+ target_link_libraries(${target} PRIVATE ${plugin_libraries} ${init_libraries})
+ endif()
+ endif()
+endfunction()
diff --git a/cmake/QtPostProcessHelpers.cmake b/cmake/QtPostProcessHelpers.cmake
index 0a207f6634..53ff7e1358 100644
--- a/cmake/QtPostProcessHelpers.cmake
+++ b/cmake/QtPostProcessHelpers.cmake
@@ -653,13 +653,19 @@ set(__qt_internal_initial_qt_cmake_build_type \"${CMAKE_BUILD_TYPE}\")
endif()
# Save the default qpa platform.
- # Used by qtwayland/src/plugins/platforms/qwayland-generic/CMakeLists.txt. Otherwise
- # the DEFAULT_IF condition is evaluated incorrectly.
if(DEFINED QT_QPA_DEFAULT_PLATFORM)
string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS
"set(QT_QPA_DEFAULT_PLATFORM \"${QT_QPA_DEFAULT_PLATFORM}\" CACHE STRING \"\")\n")
endif()
+ # Save the list of default qpa platforms.
+ # Used by qtwayland/src/plugins/platforms/qwayland-generic/CMakeLists.txt. Otherwise
+ # the DEFAULT_IF condition is evaluated incorrectly.
+ if(DEFINED QT_QPA_PLATFORMS)
+ string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS
+ "set(QT_QPA_PLATFORMS \"${QT_QPA_PLATFORMS}\" CACHE STRING \"\")\n")
+ endif()
+
# Save minimum and policy-related CMake versions to ensure the same minimum is
# checked for when building other downstream repos (qtsvg, etc) and the policy settings
# will be consistent unless the downstream repos explicitly override them.
diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake
index 53235ee9d9..df0dfe48de 100644
--- a/cmake/QtProcessConfigureArgs.cmake
+++ b/cmake/QtProcessConfigureArgs.cmake
@@ -90,7 +90,11 @@ unset(device_options)
unset(options_json_file)
set_property(GLOBAL PROPERTY UNHANDLED_ARGS "")
while(NOT "${configure_args}" STREQUAL "")
- list(POP_FRONT configure_args arg)
+ list(POP_FRONT configure_args raw_arg)
+
+ # Condense '--foo-bar' arguments into '-foo-bar'.
+ string(REGEX REPLACE "^--([^-])" "-\\1" arg "${raw_arg}")
+
if(arg STREQUAL "-cmake-generator")
list(POP_FRONT configure_args generator)
elseif(arg STREQUAL "-cmake-use-default-generator")
@@ -156,7 +160,7 @@ while(NOT "${configure_args}" STREQUAL "")
list(POP_FRONT configure_args version)
is_valid_qt_hex_version("${arg}" "${version}")
push("-DQT_DISABLE_DEPRECATED_UP_TO=${version}")
- elseif(arg STREQUAL "--")
+ elseif(raw_arg STREQUAL "--")
# Everything after this argument will be passed to CMake verbatim.
list(APPEND cmake_args "${configure_args}")
break()
@@ -939,6 +943,7 @@ translate_string_input(platform QT_QMAKE_TARGET_MKSPEC)
translate_string_input(xplatform QT_QMAKE_TARGET_MKSPEC)
guess_compiler_from_mkspec()
translate_string_input(qpa_default_platform QT_QPA_DEFAULT_PLATFORM)
+translate_list_input(qpa_platforms QT_QPA_PLATFORMS)
translate_path_input(android-sdk ANDROID_SDK_ROOT)
translate_path_input(android-ndk ANDROID_NDK_ROOT)
diff --git a/cmake/QtPublicWalkLibsHelpers.cmake b/cmake/QtPublicWalkLibsHelpers.cmake
index f79b70c710..959283aca1 100644
--- a/cmake/QtPublicWalkLibsHelpers.cmake
+++ b/cmake/QtPublicWalkLibsHelpers.cmake
@@ -184,13 +184,13 @@ function(__qt_internal_walk_libs
if(lib_target MATCHES "^::@")
continue()
elseif(TARGET ${lib_target})
- if ("${lib_target}" MATCHES "^Qt::(.*)")
- # If both, Qt::Foo and Foo targets exist, prefer the target name without
+ if(NOT "${lib_target}" MATCHES "^(Qt|${QT_CMAKE_EXPORT_NAMESPACE})::.+")
+ # If both, Qt::Foo and Foo targets exist, prefer the target name with versioned
# namespace. Which one is preferred doesn't really matter. This code exists to
# avoid ending up with both, Qt::Foo and Foo in our dependencies.
- set(namespaceless_lib_target "${CMAKE_MATCH_1}")
- if(TARGET "${namespaceless_lib_target}")
- set(lib_target ${namespaceless_lib_target})
+ set(versioned_qt_target "${QT_CMAKE_EXPORT_NAMESPACE}::${lib_target}")
+ if(TARGET "${versioned_qt_target}")
+ set(lib_target ${versioned_qt_target})
endif()
endif()
get_target_property(lib_target_type ${lib_target} TYPE)
@@ -255,8 +255,8 @@ function(__qt_internal_walk_libs
__qt_internal_promote_target_to_global(${lib_target_unaliased})
endif()
endif()
- elseif("${lib_target}" MATCHES "^Qt::(.*)")
- message(FATAL_ERROR "The ${CMAKE_MATCH_1} target is mentioned as a dependency for \
+ elseif("${lib_target}" MATCHES "^(Qt|${QT_CMAKE_EXPORT_NAMESPACE})::(.*)")
+ message(FATAL_ERROR "The ${CMAKE_MATCH_2} target is mentioned as a dependency for \
${target}, but not declared.")
else()
if(NOT operation MATCHES "^(collect|direct)_targets$")
diff --git a/cmake/QtPublicWasmToolchainHelpers.cmake b/cmake/QtPublicWasmToolchainHelpers.cmake
index 31f6b5aca5..a8994520e2 100644
--- a/cmake/QtPublicWasmToolchainHelpers.cmake
+++ b/cmake/QtPublicWasmToolchainHelpers.cmake
@@ -83,8 +83,6 @@ function(__qt_internal_get_qt_build_emsdk_version out_var)
file(READ "${WASM_BUILD_DIR}/src/corelib/global/qconfig.h" ver)
elseif(EXISTS "${WASM_BUILD_DIR}/include/QtCore/qconfig.h")
file(READ "${WASM_BUILD_DIR}/include/QtCore/qconfig.h" ver)
- else()
- message("qconfig.h not found, unable to determine Qt build Emscripten version")
endif()
if (ver)
string(REGEX MATCH "#define QT_EMCC_VERSION.\"[0-9]+\\.[0-9]+\\.[0-9]+\"" emOutput ${ver})
@@ -99,7 +97,7 @@ function(_qt_test_emscripten_version)
__qt_internal_query_emsdk_version("${emroot_path}" TRUE current_emsdk_ver)
__qt_internal_get_qt_build_emsdk_version(qt_build_emcc_version)
- if(NOT "${qt_build_emcc_version}" STREQUAL "${current_emsdk_ver}")
+ if(NOT "${qt_build_emcc_version}" STREQUAL "" AND NOT "${qt_build_emcc_version}" STREQUAL "${current_emsdk_ver}")
message("Qt Wasm built with Emscripten version: ${qt_build_emcc_version}")
message("You are using Emscripten version: ${current_emsdk_ver}")
message("The recommended version of Emscripten for this Qt is: ${_recommended_emver}")
diff --git a/cmake/QtTargetHelpers.cmake b/cmake/QtTargetHelpers.cmake
index e669047ff1..3740e85803 100644
--- a/cmake/QtTargetHelpers.cmake
+++ b/cmake/QtTargetHelpers.cmake
@@ -99,10 +99,13 @@ function(qt_internal_extend_target target)
get_target_property(target_type ${target} TYPE)
set(is_library FALSE)
set(is_interface_lib FALSE)
+ set(is_executable FALSE)
if(${target_type} STREQUAL "STATIC_LIBRARY" OR ${target_type} STREQUAL "SHARED_LIBRARY")
set(is_library TRUE)
elseif(target_type STREQUAL "INTERFACE_LIBRARY")
set(is_interface_lib TRUE)
+ elseif(target_type STREQUAL "EXECUTABLE")
+ set(is_executable TRUE)
endif()
foreach(lib ${arg_PUBLIC_LIBRARIES} ${arg_LIBRARIES})
@@ -273,6 +276,20 @@ function(qt_internal_extend_target target)
set_target_properties(${target} PROPERTIES
_qt_extra_linker_script_exports "${arg_EXTRA_LINKER_SCRIPT_EXPORTS}")
endif()
+
+ if(is_executable)
+ # If linking against Gui, make sure to also build the default QPA plugin.
+ # This makes the experience of an initial Qt configuration to build and run one single
+ # test / executable nicer.
+ set(linked_libs ${arg_PUBLIC_LIBRARIES} ${arg_LIBRARIES})
+ if(linked_libs MATCHES "(^|;)(${QT_CMAKE_EXPORT_NAMESPACE}::|Qt::)?Gui($|;)" AND
+ TARGET qpa_default_plugins)
+ add_dependencies("${target}" qpa_default_plugins)
+ endif()
+
+ # For executables collect static plugins that these targets depend on.
+ qt_internal_import_plugins(${target} ${linked_libs})
+ endif()
endfunction()
# Given CMAKE_CONFIG and ALL_CMAKE_CONFIGS, determines if a directory suffix needs to be appended
diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake
index 705de2f739..b6bba5ed12 100644
--- a/cmake/QtTestHelpers.cmake
+++ b/cmake/QtTestHelpers.cmake
@@ -566,12 +566,14 @@ function(qt_internal_add_test name)
LIBRARIES ${QT_CMAKE_EXPORT_NAMESPACE}::QuickTest
)
- qt_internal_extend_target("${name}" CONDITION arg_QMLTEST AND NOT ANDROID
+ qt_internal_extend_target("${name}"
+ CONDITION arg_QMLTEST AND NOT ANDROID AND NOT QT_FORCE_BUILTIN_TESTDATA
DEFINES
QUICK_TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
)
- qt_internal_extend_target("${name}" CONDITION arg_QMLTEST AND ANDROID
+ qt_internal_extend_target("${name}"
+ CONDITION arg_QMLTEST AND (ANDROID OR QT_FORCE_BUILTIN_TESTDATA)
DEFINES
QUICK_TEST_SOURCE_DIR=":/"
)
@@ -774,7 +776,7 @@ function(qt_internal_add_test name)
endif()
endif()
- if(ANDROID OR IOS OR WASM OR INTEGRITY OR arg_BUILTIN_TESTDATA)
+ if(ANDROID OR IOS OR WASM OR INTEGRITY OR arg_BUILTIN_TESTDATA OR QT_FORCE_BUILTIN_TESTDATA)
set(builtin_testdata TRUE)
endif()
diff --git a/cmake/configure-cmake-mapping.md b/cmake/configure-cmake-mapping.md
index d504bd8d4b..bc52065903 100644
--- a/cmake/configure-cmake-mapping.md
+++ b/cmake/configure-cmake-mapping.md
@@ -97,7 +97,7 @@ The following table describes the mapping of configure options to CMake argument
| -skip <repo>,...,<repo_n> | -DBUILD_<repo>=OFF | |
| -skip-tests <repo>,...,<repo_n> | -DQT_BUILD_TESTS_PROJECT_<repo>=OFF | |
| -skip-examples <repo>,...,<repo_n> | -DQT_BUILD_EXAMPLES_PROJECT_<repo>=OFF | |
-| -submodules <repo>,...,<repo_n> | -DQT_BUILD_SUBMODULES=<repo>;...;<repo> | |
+| -submodules <repo>,...,<repo_n> | -DQT_BUILD_SUBMODULES=<repo>;...;<repo> | |
| -make <part> | -DQT_BUILD_TESTS=ON | A way to turn on tools explicitly is missing. If tests/examples |
| | -DQT_BUILD_EXAMPLES=ON | are enabled, you can disable their building as part of the |
| | | 'all' target by also passing -DQT_BUILD_TESTS_BY_DEFAULT=OFF or |
@@ -145,7 +145,8 @@ The following table describes the mapping of configure options to CMake argument
| -opengl <api> | -DINPUT_opengl=<api> | |
| -opengles3 | -DFEATURE_opengles3=ON | |
| -egl | -DFEATURE_egl=ON | |
-| -qpa <name> | -DQT_QPA_DEFAULT_PLATFORM=<name> | |
+| -qpa <name>;...;<name_n> | -DQT_QPA_PLATFORMS=<name>;...;<name_n> | |
+| -default-qpa <name> | -DQT_QPA_DEFAULT_PLATFORM=<name> | |
| -xcb-xlib | -DFEATURE_xcb_xlib=ON | |
| -direct2d | -DFEATURE_direct2d=ON | |
| -directfb | -DFEATURE_directfb=ON | |
diff --git a/cmake/visionos/Info.plist.app.in b/cmake/visionos/Info.plist.app.in
index 7aa4698649..984b7aa10b 100644
--- a/cmake/visionos/Info.plist.app.in
+++ b/cmake/visionos/Info.plist.app.in
@@ -38,5 +38,13 @@
<array>
<string>XROS</string>
</array>
+
+ <key>UIApplicationSceneManifest</key>
+ <dict>
+ <key>UIApplicationSupportsMultipleScenes</key>
+ <true/>
+ <key>UISceneConfigurations</key>
+ <dict/>
+ </dict>
</dict>
</plist>