summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Postpone target existence check for qml plugin targetsAlexandru Croitor2021-10-181-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each included qml Qt6FooPluginTargets.cmake file checks whether all the dependency targets that are referenced in the file already exist by the time the file is included. If one of the referenced targets is missing, the file sets ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE with a message mentioning which targets are missing and also sets ${CMAKE_FIND_PACKAGE_NAME}_FOUND to FALSE. All our qml package Config.cmake and Targets.cmake files are include()d by Qt6QmlPlugins.cmake using a file(GLOB) which means the order in which the files are loaded is implementation-defined. Furthermore we didn't check the above set variables after each inclusion, which means the values are overridden and the last plugin to be loaded determines whether the Qml package is found or not. If the last included file sets no error, it effectively silences any previously set error. Ever since we added dependencies between the qml plugin targets themselves, we hit the above situation and depending on the platform, no error was shown because the last file overrode any errors. But we finally got a specific platform (wasm) which unearthed the problem (QTBUG-97478). This can happen for any static Qt build though. To fix this properly, we will most likely have to rewrite the whole inclusion mechanism to use find_package() so that dependencies can be resolved recursively as needed. This is a non-trivial change that will have to be addressed in both qtbase and qtdeclarative. In the mean time, a stop-gap solution that this change implements is to include all the files while ignoring any error messages. Then include the files one more time and check for error message after each included file. All qml plugin targets should have been brought into scope with the first round of inclusions, thus circumventing "missing referenced target" errors, while still catching any other possible errors. Amends 6fd1216801f078f65be2cbc748cc459cb6912a4f 9fc302e6d146878103b3d105dce49c7695fcf93a c368175a9e0a0c120b5bb8a0a02859bfc0cf42ba in qtdeclarative. Fixes: QTBUG-97478 Task-number: QTBUG-95609 Task-number: QTBUG-97099 Change-Id: I157fa93fc979d726cd221d969b995b3642aeec77 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit aad4158959890b72afdd062614c1142c100c65b5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix build with CMake 3.16Joerg Bornemann2021-10-131-3/+7
| | | | | | | | | | | | Do not read the target property LINK_LIBRARIES from interface libraries as this leads to errors with CMake 3.16. This amends commit 326b91ea788b013512ae911c51cc19497d88916d. Change-Id: I44251c7633d5ecd977cd05746ac311dd1285d1e3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 0098e0ca86b69cfbd89528977dadb2ac3e616eed) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix config tests not finding module-provided CMake packagesJoerg Bornemann2021-10-131-1/+6
| | | | | | | | | | | | | | | | | This amends commit 165e01d5d51d16377542c1b3ffbc22f03fb75e97. Above commit broke the code that adds "${PROJECT_SOURCE_DIR}/cmake" to CMAKE_MODULE_PATH. The semicolon that separates entries of CMAKE_MODULE_PATH must be escaped. Otherwise, the semicolon separates elements of the flags list. Additionally, fix the QT_AVOID_CUSTOM_PLATFORM_MODULES code path which lacked the addition of "${PROJECT_SOURCE_DIR}/cmake". Change-Id: I72f78cf066cabe6b0002dce1aa0294aa0dc9cbf0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 8b09c9d6902dd49a665df8a02ecef8c5a7a4639e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix missing QT.<module>.run_depends entries in module .pri filesJoerg Bornemann2021-10-121-17/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | The .pri files for public Qt modules were missing run_depends entries. Those entries are used by qmake when linking plugins of a static Qt build. In shared builds, run_depends entries are used to decide whether to add the -rpath-link argument to the linker. In that matter, run_depends entries serve a similar purpose as CMake's IMPORTED_LINK_DEPENDENT_LIBRARIES. In Qt5, run_depends entries consist of the qmake values QT_PRIVATE and QT_FOR_PRIVATE. QT_PRIVATE contains the Qt modules that are privately linked to the public module, and QT_FOR_PRIVATE are the dependencies of the private module. That loosely translates to LINK_LIBRARIES of the public module and INTERFACE_LINK_LIBRARIES of the private module. Private modules whose public counterparts are already public dependencies don't have to be added to run_depends. Fixes: QTBUG-84310 Change-Id: If7025c98ea462a2d5a143202df3d98d88e4fee08 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 326b91ea788b013512ae911c51cc19497d88916d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Ensure that UNIX is set for INTEGRITYJoerg Bornemann2021-10-055-1/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Certain platform-related variables, in this case UNIX, must be set in a platform module, because they get cleared after the toolchain file is loaded. Such platform modules live in upstream CMake, but there is none yet for INTEGRITY. This manifests in an undefined UNIX variable and "System is unknown to CMake" warnings for the project and every configure test. Add the CMake module "Platform/Integrity" in the cmake/platforms directory. Add this directory to CMAKE_MODULE_PATH to let CMake load Platform/Integrity when the toolchain file set CMAKE_SYSTEM_NAME to "Integrity". CMake's module directory takes precedence, when loading platform modules. This is special for platform modules and different from the documented behavior of CMAKE_MODULE_PATH and include(). In case the user wants to provide their own platform modules via CMAKE_MODULE_PATH, they can instruct Qt to not add its path by setting QT_AVOID_CUSTOM_PLATFORM_MODULES to ON. Make sure that configure tests with project files also load the custom platform module. Fixes: QTBUG-96998 Change-Id: I9855d620d24dc66353cec5e847a2675b464ace26 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 165e01d5d51d16377542c1b3ffbc22f03fb75e97) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* wasm: add simd supportLorn Potter2021-10-053-0/+12
| | | | | | | | | | | | | | | | | | | Emscripten only supports SSE1, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, and 128-bit AVX instruction sets at this time. https://emscripten.org/docs/porting/simd.html Browsers might need to enable simd support in the advanced configurations about: config or chrome:flags Enable by configuring Qt with -sse2 Fixes: QTBUG-63924 Change-Id: Ifeafae20e199dee0d19689802ad20fd0bd424ca7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 0e100a4d892cbdcdb7f326213ec1e4d0d1ae6d89) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "CMake: Warn if cmake_minimum_required has an unsupported low version"Alexandru Croitor2021-10-046-114/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 657525965b86cfa135bb5a814a537443163acb14. The change relied on reading the last value of the CMAKE_MINIMUM_REQUIRED_VERSION variable before one of the Qt packages is found to use it for the version check. Even if a user project has a cmake_minimum_required() right at the beginning of the project with a supported version specified, the first project() call which loads a CMake toolchain file could contain another cmake_minimum_required() call with a lower (unsupported) version and that version would be used for the check, failing the project configuration. The Android NDK ships such a toolchain file, which requires version '3.6'. Thus, relying on the last value of CMAKE_MINIMUM_REQUIRED_VERSION is not robust enough. Task-number: QTBUG-95018 Task-number: QTBUG-95832 Change-Id: Iff3cb0a46e6e878569dce9c5fe915a714a034904 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 99899dd299eccc0a2133b45a04d80cb0e438f773) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't export Qt6::ATSPI2_nolink target in Qt6GuiTargets.cmakeJoerg Bornemann2021-10-011-9/+21
| | | | | | | | | | | | | | | We don't have any APSPI2 includes in our public headers and should therefore not export the target that provides ATSPI2 include paths for consumers. Link against PkgConfig::ATSPI2 instead of the _nolink target. The former will not be exported. Fixes: QTBUG-97023 Change-Id: I4b12e0c2230917feeb963c02565e6db24f757bd3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit f6cd55445d38cb5932f4cfcb5c6d4b9ac187c3eb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Warn if cmake_minimum_required has an unsupported low versionAlexandru Croitor2021-10-016-0/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt6Config.cmake calls cmake_minimum_required to ensure a recent enough CMake version is used in projects. That call does not set policies in the calling subdirectory scope, because find_package introduces a new policy scope. If a project using Qt has a 'cmake_minimum_required(VERSION 3.1)' call and is configured with a recent CMake, many policies will still be set to OLD. One such policy is CMP0071 (Run AUTOMOC on GENERATED files). The policy value is queried at generation time rather than at target definition time, which means we can't influence the policy value (e.g. inside the implementation of qt_add_executable for example) The inability to influence the policy value for targets created by our own CMake functions is unfortunate and can lead to issues (in the case of the above policy to compilation / linker issues). Record the version of the last cmake_minimum_required call before the Qt packages are found and error out if the version is lower than the minimum supported one. A project can reduce the error into a warning by specifying a -DQT_FORCE_MIN_CMAKE_VERSION_FOR_USING_QT_IN_CMAKE_MIN_REQUIRED=3.xyz option when configuring the project. If the option is used and build issues arise, no official support is given. All the CMake example projects shipped with Qt specify a minimum version of 3.16 already (which is the minimum for shared Qt builds), so it shouldn't be an issue to require that in other user projects as well. Implementation wise, we follow the existing pattern to record what the minimum and computed versions for static and shared Qt builds are at qtbase configure time. These are then checked before the Qt6 or QtFoo packages are find_package'd. Amends 6518bcc167d47e1c27d082c21551b9a838b04e5d Task-number: QTBUG-95018 Task-number: QTBUG-95832 Change-Id: I1a1d06d82f566c92192a699045127943604c8353 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 657525965b86cfa135bb5a814a537443163acb14) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Introduce QT_BUILD_ONLINE_DOCS flag for documentation buildsTopi Reinio2021-09-301-2/+10
| | | | | | | | | | | | | | | | | | QDoc modifies its linking behavior depending on whether the -installdir command line option was set or not; Without -installdir, QDoc will use 'https://<url>' to link to targets loaded from external documentation modules, instead of using relative paths. Drop the -installdir if QT_BUILD_ONLINE_DOCS was set. This behavior matches the 'build_online_docs' scope that was used for qmake documentation targets, and is useful for documentation projects that are not part of Qt but want to link to Qt docs simply by loading the index files of Qt's modules. Change-Id: Ib1bbf7b9d784e0c276d2bc520240af4a6c8ba903 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 725b52141d553590d395d51963ee8b60f99ca40d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix separate_debug_info configure test for cross-compilationJoerg Bornemann2021-09-291-0/+3
| | | | | | | | | | | | | | | The separate_debug_info configure test uses the CMake variable CMAKE_OBJCOPY. CMakeFindBinUtils in the test project finds the host's objcopy despite CMAKE_TOOLCHAIN_FILE being correctly set. We now add CMAKE_OBJCOPY to the list of variables that are passed to configure test projects and remove the CMakeFindBinUtils include, which looks rather internal anyways. Fixes: QTBUG-96798 Change-Id: I164c6bd1771e8789e9dd19b50573b33b8866bd3b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 5ef0e3435ee00fc5b975fb2f2e9100d98542e591)
* CMake: Only write device prefix to target_qt.conf if necessaryJoerg Bornemann2021-09-291-1/+3
| | | | | | | | | | | | | | | | | The device prefix in target_qt.conf is necessary if and only if the prefix on the host is different from the prefix on the device - in CMake terms: if CMAKE_STAGING_PREFIX is different from CMAKE_INSTALL_PREFIX. This removes the [Devices] section from target_qt.conf from our iOS and Android packages, because we don't set CMAKE_STAGING_PREFIX for those platforms. Fixes: QTBUG-96906 Change-Id: I1390e952e544e57d5dd3bc09d688a612db9b4247 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit acde9784cada212ac23efd7027dc7091a45f9abd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Show error in user projects if wasm toolchain file not foundAlexandru Croitor2021-09-274-5/+31
| | | | | | | | | | | | Rather than fail with obscure can't find Qt packages errors when the Webassembly CMake toolchain file can not be found, error out with a clear error on how to ensure it is found. Task-number: QTBUG-96843 Change-Id: I0f34cdcde05efb25c93017f3fd365186335ed52c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 2ed267c82015f5eab7fe65aad6553eb0d6bb338d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Get toolchain file path from EMSDK env for Wasm user projectsAlexandru Croitor2021-09-272-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Try to to chainload the emscripten CMake toolchain file from the EMSDK env var if it is set, instead of requiring the user to explicitly specify a path to the file via QT_CHAINLOAD_TOOLCHAIN_FILE. The order in which the toolchain file is chainloaded becomes is as follows: 1) The initial toolchain file path that was specified when configuring qtbase is set written as the initial value of __qt_chainload_toolchain_file in qt.toolchain.cmake 2) If EMSDK env var is set, it overrides the value from 1) 3) If QT_CHAINLOAD_TOOLCHAIN_FILE cache var is supplied it overrides the value from 2) Whichever value ends up in __qt_chainload_toolchain_file is checked too see if the file exists. If it exists it gets included, if it doesn't, a warning is issued. This checking logic is a bit crude and should be improved and unified with the Android chainload checking, but the current change already improves the behavior for users of Qt. Task-number: QTBUG-96843 Change-Id: I5da58a329f659086aaaee765c9399d0369021b22 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 5d840f0f7a575a5163800519d7ef7d4ba228135a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Split and clean up WebAssembly auto-detection codeAlexandru Croitor2021-09-273-35/+83
| | | | | | | | | | | | | | | Split qt_auto_detect_wasm into multiple helper functions and place them in a new QtPublicWasmToolchainHelpers.cmake file. We want to use them to try and detect the CMake toolchain file location from within the generated qt.toolchain.cmake file whem configuring a user project. Task-number: QTBUG-96843 Change-Id: Id8c2350e6dbe3c994b435681353bdaee114249a7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit c7d9e05a2bd55f03a01b5319338828197e81bc39) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Bump almost all cmake_minimum_required calls to 3.16Alexandru Croitor2021-09-243-3/+3
| | | | | | | | | | | | | Needed for subsequent change that will check and error out if the version is lower than 3.16. We do that to ensure all policies introduced by CMake up to version 3.16 have their behavior set to NEW. Task-number: QTBUG-95018 Change-Id: Ieaf82c10987dd797d86a3fd4a986a67e72de486a Reviewed-by: Kai Koehne <kai.koehne@qt.io> (cherry picked from commit 0da123d67b0fd332691f98ae6957ef05e9e20e84) Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Use only supported values when setting internal QT_FEATURE_ valuesAlexey Edelev2021-09-211-1/+5
| | | | | | | | | | | | When setting QT_FEATURE_ values we need to convert the user-provided FEATURE_ values to the one that is supported by QT_FEATURE_. Fixes: QTBUG-96300 Change-Id: Idd19fbf7f23f351a6c1cfdcedccfaaf6b0aa6e44 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 68ad67b6faf6922c66ddafee0dc055666a73cddd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add missing framework paths to header check targetsAlexey Edelev2021-09-201-0/+15
| | | | | | | | | | | | | | | | | | CMake doesn't add framework include paths for the includes if add_custom_command is used. When all Qt modules are installed to a single directory, frameworks could be found under QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX, but for Conan builds each module is installed to the separate directory. These directories need to be listed in the QT_ADDITIONAL_PACKAGES_PREFIX_PATH variables family. This takes into account directories that are listed in the QT_ADDITIONAL_PACKAGES_PREFIX_PATH variables and considers they can contain frameworks. Fixes: QTBUG-96511 Change-Id: I664381df4859a2e85c399cd94dc2f3996e452c03 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 2483931e25b6040e14af99bb56c505e9c082e758) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix main() not being visible on AndroidCraig Scott2021-09-201-0/+8
| | | | | | | | | | | | | | | A recent change refactored the call to qt_internal_add_executable(), but that had the unintended side-effect of changing the symbol visibility from public to hidden. That meant that main() became hidden, so while apps still built successfully, they could not be run. Restore the original symbol visibility to fix this regression. Amends d47278fd09f73ddc34011ab980dafc23aa453e71 Change-Id: I27d84ab2b0dd013d5c38dcfe55e88f307c4bc5dd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 46438c91f71249d89b17fd80ec0a00cd9166c63e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use _qt_module_has_headers instead of INTERFACE_MODULE_HAS_HEADERSAlexey Edelev2021-09-183-4/+2
| | | | | | | | | | | | After introducing the _qt_module_has_headers target property, it's better to replace the INTERFACE_MODULE_HAS_HEADERS use by _qt_module_has_headers since properties duplicate each other. Change-Id: I4d62ed71b8ed8263f51d8575628693122580b4a7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit f0bb95cb6330cdb3e1b749ed5b1c222bbe3050bc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove unused EXE_FLAGS option from qt_internal_add_executable()Craig Scott2021-09-172-3/+1
| | | | | | | | | | | The EXE_FLAGS option wasn't being used anywhere in any Qt repo and it had no documentation as to its intended use. Remove it. Change-Id: I2f67ec57c1da7dc6eab81d5351361e770d19d7d5 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit b57f7f07cf932bc61878473a492d7c39f15bcfbd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove TODOs related to checking CMake 3.21 features post-releaseCraig Scott2021-09-172-4/+0
| | | | | | | | | | | | These TODOs were left as a marker to be checked once the official CMake 3.21.0 release was made. The things they refer to were included in the CMake 3.21.0 release, so the TODOs can be removed. Fixes: QTBUG-94528 Change-Id: I769605de85df657ad056123e787ec9849b77e42f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit c780708bd3ad58f1aade92df9c0cee7adcbd46f3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Ensure _qt_is_android_executable is set for internal executables tooCraig Scott2021-09-171-13/+2
| | | | | | | | | | | | | | | | | | The _qt_is_android_executable property is normally set by the _qt_internal_create_executable() command. But various other internal commands don't route through that and go through qt_internal_add_executable() instead. The former is used only by the public API, the latter only by the internal API. Refactor both so that the internal one calls the public one. This ensures all targets receive the same base settings, including the _qt_is_android_executable property. Fixes: QTBUG-96085 Change-Id: I157356872c9d942d7be5f1abbbcbac97961b1f40 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit d47278fd09f73ddc34011ab980dafc23aa453e71) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Make standalone tests TestsConfig file repo-target-set specificAlexandru Croitor2021-09-162-3/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conan CI builds can built a qt repository in a repo-target-set configuration. An example of that is qtscxml. When building standalone tests, qt_build_tests includes a repo specific TestsConfig.cmake file to call find_package on the modules that were built as part of that repo. That doesn't quite work with a repo-target-set build which is enabled when the repo is built with a QT_BUILD_SINGLE_REPO_TARGET_SET value. The TestsConfig.cmake file would be overridden with different contents on each configuration. Fix that by including the QT_BUILD_SINGLE_REPO_TARGET_SET value as part of the TestsConfig.cmake file to be generated and included. This means that when configuring the standalone tests, the same QT_BUILD_SINGLE_REPO_TARGET_SET value should be passed, so that the correct packages are found. Add some debug statements to allow checking which TestsConfig.cmake file is loaded when the standalone tests are configured with --log-level=DEBUG. Adjusts to 4b09522c23e9efdf83ba8d4af436d8a700ccb66e Amends de3a806def4b9a754825a2233c9d4952a9b2d0eb Amends e7f188b2d2f10941006be7b0e7197b3c1ebdefdb Task-number: QTBUG-96253 Change-Id: I7c22aaad88fe8e6fce23046543363316203f6e8d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit d470497d9a05fbdc251a2524f2d11ea6f90fa7c6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qdevice.pri: Use cmake separators for the pathMårten Nordheim2021-09-101-0/+2
| | | | | | | | | | Because otherwise we may end up with trailing backslashes Change-Id: I7ad24ec34c35f0a7b32241751bbcd2b26a8a23ea Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit a2653331330340c4f44457c49005f4c7226b8316) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid implicit linking of plugin init library if finalizers were calledAlexey Edelev2021-09-081-0/+2
| | | | | | | | | | | | Propagating of plugin init libraries should take into account plugin finalizers to avoid duplicating of object files in a linker line. Fixes: QTBUG-96062 Change-Id: I48feac94b08a7eb08d84134e9e9ae6e7214f5bdd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 7e794d71c0bf0f6e812aa1c7794b709889f202fd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Remove unnecessary IF DEFINED HOST_PERL checkAlexandru Croitor2021-09-081-3/+0
| | | | | | | | | | The variable might be defined to HOST_PERL-NOTFOUND which will return early instead of issuing an error. Change-Id: Id49dfd0fec8f477dad9e816e6128e36059e68702 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 6d20630b066286dbe2d4cb8e7aa0b07bc498bfcd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Allow opting out of building examples as ExternalProjectsAlexandru Croitor2021-09-063-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We default to configuring examples as separate ExternalProjects when using a developer / non-prefix Qt build. This ensures we test that the examples configure successfully without the pollution of the main Qt build (e.g. already found packages). One down-side of this is that a developer's IDE doesn't see these example targets, unless each project is loaded into the IDE separately. This is cumbersome to do when refactoring or renaming code across multiple example projects. Allow configuring the example projects as part of the main Qt build by setting QT_BUILD_EXAMPLES_AS_EXTERNAL to FALSE when configuring Qt. Save the value of the variable in QtBuildInternalsExtra.cmake.in so it's propagated to leaf repositories as well. Amends dab8f64b6d5d4241b678d0227355858071376496 Amends d97fd7af2bc5c89a0ad9e5fac080041b78d01179 Task-number: QTBUG-90820 Task-number: QTBUG-94608 Task-number: QTBUG-96232 Task-number: QTCREATORBUG-26168 Change-Id: Ie1f724f74365b3a788b04c3fffe9eb2d0611dd50 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit c8dbb177f03bcd8e65b8fac1008fe276fada2c92) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix 'Cannot find source file' error with older CMakesAlexandru Croitor2021-09-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Configuring a static plugin init library with CMake versions earlier than 3.18.0 fails at generation phase with CMake Error at Qt6CoreMacros.cmake:2071 (add_library): Cannot find source file: example/plugins/basictools/pnp_basictools_init.cpp Call Stack (most recent call first): qtbase/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:1998 (_qt_internal_add_library) qtbase/lib/cmake/Qt6/QtPublicPluginHelpers.cmake:243 (qt6_add_library) qtbase/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:1967 (__qt_internal_add_static_plugin_init_object_library) qtbase/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:1989 (qt6_add_plugin) qtbase/plugins/basictools/CMakeLists.txt:1 (qt_add_plugin) Marking the generated file as GENERATED explicitly solves the issue. Similar to e2c6f2ba7ed72195d12e9882c174e59a53317097 Fixes: QTBUG-96197 Change-Id: If730a1fcbe6910d6041eb6eba03d6e45a025c424 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit d7c6d69a8c54d4ac3b6872f619dfefe2c47377b1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Don't cache QT_SYNCQT across buildsJoerg Bornemann2021-09-032-10/+13
| | | | | | | | | | | | | | | | | | | | | | | There is no need for this variable to be stored in CMake's cache. We don't perform expensive operations to set up QT_SYNCQT, and we even unset the cache variable to ensure it gets recomputed on reconfiguration. We still store QT_SYNCQT in a global property, because the function qt_ensure_sync_qt is called in different directory scopes, and we want to avoid re-calculations for every subdir. It's now possible for the user to set QT_SYNCQT (see QTBUG-88088 for motivation). Also, in a non-prefix build, changes to syncqt.pl in the source dir are reflected upon re-configuration in the build tree (because qt_copy_or_install is called on every configure). Fixes: QTBUG-88088 Task-number: QTBUG-75290 Change-Id: I6137b060d200d3dafd4a64d5a6c1bd2549723d78 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 60f36007a361f4102a9cc0ceb65040ebc19d2653) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* wasm: fail when configuring for wasm and EMSDK is not foundLorn Potter2021-09-011-1/+6
| | | | | | | Change-Id: Ic7fb933d8c2b42c3ba84a3b5a6c89a808d971bd1 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 375c7c47ff29d40ace4b489738510fac96997c21) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update Android default SDK from 29 to 30Juha Vuolle2021-08-271-1/+1
| | | | | | | | | | | | By the time of Qt 6.2 release all new apps targeting Play store must target API level 30 (Android 11) or above (starting in 08/2021 for new apps and 11/2021 for existing apps' updates). Task-number: QTBUG-94451 Change-Id: Id7fa2fd62899a7259e365c917292c6c3ac0d2b0d Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 17d7a8dc2e2df577a769cd84cba946a726e8872a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Call MinGW's ld with -Bstatic when requesting static runtime linkageJoerg Bornemann2021-08-271-1/+1
| | | | | | | | | | | | The -static argument we used before is supported by ld, but not lld. The latter requires --static or -Bstatic. Use -Bstatic, which is supported by both. Fixes: QTBUG-89549 Change-Id: I3c3069661bf4cd20e3298aff4714163b7419d3ef Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit d94652f7927945f988f2c99cee98076efd5c1d79) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Warn when PRIVATE_MODULE_INTERFACE is provided with no targetAlexandru Croitor2021-08-271-2/+10
| | | | | | | | | | | | | Warn if the PRIVATE_MODULE_INTERFACE option is provided a value, but there is no ${target}Private target to set the interface dependencies on. Task-number: QTBUG-95921 Change-Id: I7d4df9cb3aa9b7746d836b82019ecdd9c8f50fdc Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 0dbf73e3deb9727da0376abf131d764251969114) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Properly export MODULE_PLUGIN_TYPESAlexandru Croitor2021-08-262-1/+4
| | | | | | | | | | | | | | | | | Don't export the MODULE_PLUGIN_TYPES property only when a module has an associated configure.cmake file with features. Instead, always export it if a module defines a plugin type. This fixes qttools DesignerTargets.cmake file to contain the plugin types it defines, given that the Designer lib does not declare any features via a configure.cmake file. Task-number: QTBUG-95668 Change-Id: Ic036c31768e03b51d3bce9c2afe48e04f69f435b Reviewed-by: Michal Klocek <michal.klocek@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit d806ce6fc57cf402668ecf73aa8531be5f201f9c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add missing PRIVATE_MODULE_INTERFACEs to INTERNAL_MODULEsAlexey Edelev2021-08-242-0/+10
| | | | | | | | | | | | | | | To detect the internal module ouside the qt_internal_add_module function need to mark it with the property. This adds _qt_is_internal_module property to the Qt internal modules. Since PRIVATE_MODULE_INTERFACE only was applicable to pure Private modules, INTERNAL_MODULEs is missing those dependencies if they were specified. Add extra condition to qt_internal_extend_target to link PRIVATE_MODULE_INTERFACE libraries to internal modules as well. Change-Id: I9c32fa5bad3aff365f5d7663349e5365d5f1d72d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit abb19da5727c63783c64caefa11562a9086b4707) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Create plugin initializers for static user pluginsAlexandru Croitor2021-08-241-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we only created object library static plugin initializers for Qt plugins only, not user-project plugins. The reason was that if a user tried to install the plugin target via an export set, CMake would error out saying that the _init library is not part of the same export set. Introduce an OUTPUT_TARGETS option that would allow projects to get the name of the generated _init target, so they can install it if needed. This was already done for qt6_add_qml_module, so we just introduce the same option for qt6_add_plugin. Now user static plugins will have an _init target created, which will be propagated to consumers whenever the consumers link against the plugin itself. We also need an internal option to disable this propagation, because it's handled a bit differently for Qt plugins which can be linked either via finalizers or via usage requirements. Amends 91c65dd80cdd2de666448c14202c0c63718152b6 As a result of the implementation change, cleanup example projects to ensure that they build successfully (the important part is specifying the CLASS_NAME). Only plugandpaint works properly with both shared and static Qt builds. echoplugin works with a shared Qt build, but not a static one due to some assumptions in the C++ code about shared plugins. styleplugin doesn't seem to work properly neither with shared Qt builds nor static Qt builds, at least on macOS. But it builds fine. For some reason even if the plugin is found, the style is not applied. Amends 4caac1feea025b0ad496141e8f16ab88c04c2caa Task-number: QTBUG-80863 Task-number: QTBUG-92933 Change-Id: I6f631cda9566229b7a63992b23d7d7fa50303eeb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 3c1125d9fe41332087ab6213a5514426109ead08) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix excessive size of precompiled header filesJoerg Bornemann2021-08-241-3/+3
| | | | | | | | | | | | | | | | Do not add catch-all header files like QtCore, QtGui, etc. to precompiled headers for targets that already define their own set of precompiled header files. This reduces the size of the precompiled headers and brings the pch file sizes down into the region of the qmake build. Task-number: QTBUG-89122 Change-Id: I8e4d17aa6829c7d7b1aa01a01a61b6677e22c460 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 278368b523e974665b60d22a0eaf27d9ed130078) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add missing -help argument to qt-configure-moduleJoerg Bornemann2021-08-201-0/+22
| | | | | | | | | | | | Now it's possible to display a configure help screen per module with qt-configure-module <module-source-dir> -help Fixes: QTBUG-95943 Change-Id: I7d26006246af4b38b5a2ec6deca3f45c5313afec Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 1ac947e3af42f8a93d9c85a4bce4f242085c4173) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix our usage of CMake script mode in Windows configureJoerg Bornemann2021-08-201-19/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a preparation for adding the -help argument to qt-configure-module.bat. Consider the call qt-configure-module.bat path/to/qt-module -help Internally, we called cmake ... -P .../QtWriteArgsFile.cmake path/to/qt-module -help which was supposed to separate the arguments and write them into config.opt. However, passing arbitrary arguments after "-P script.cmake" only worked by accident and is not supported. As soon as arguments are passed that are valid CMake arguments, like -help or -G, the CMake call would fail. Now, we let configure.bat and qt-configure-module.bat write the arguments as is into config.opt.in and let QtWriteArgsFile.cmake read this file, separate the arguments and write config.opt. Task-number: QTBUG-95943 Change-Id: I80f298a2aaf55b0f79fed86320a055eb2d2b6faa Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 57ad532e75f62212f24dd2791583b975d09aca9d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix Android -ltcg buildJoerg Bornemann2021-08-201-2/+8
| | | | | | | | | | | | | | | We're passing -Oz for release builds, but that's not a flag the linker understands when -ltcg is enabled. The build fails with: ld.gold: fatal error: Optimization level must be between 0 and 3 Fix this by using -O2, which -Oz is based on, and -O3 for the "full optimization" that is used for core and gui. Fixes: QTBUG-89472 Change-Id: Ie1a86888baefce5ca97026e7d635f10d2819f9f4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 80de5165658e1cfb12d0813ea93dcfecca0dcb45) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix QT_ADDITIONAL_PACKAGES_PREFIX_PATH for cross-buildsAlexandru Croitor2021-08-195-16/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QT_ADDITIONAL_PACKAGES_PREFIX_PATH variable was introduced to allow specifying extra locations to find Qt packages. The reason it was introduced instead of just using CMAKE_PREFIX_PATH is because the Qt6 component find_package call uses NO_DEFAULT_PATH which means CMAKE_PREFIX_PATH is ignored. We use NO_DEFAULT_PATH to ensure we don't accidentally pick up system / distro Qt packages. The paths from QT_ADDITIONAL_PACKAGES_PREFIX_PATH are added to the find_package PATHS option in the Qt6 package, each ModuleDependencies.cmake file and some other places. Unfortunately that's not enough to make it work for cross-builds. Imagine the following scenario. host qtbase, qtdeclarative installed in /host_qt target qtbase installed in /target_qtbase target qtdeclarative installed in /target_qtdeclarative We want to cross-build qtlottie. We configure qtlottie as follows /target_qtbase/bin/qt-configure-module /qtlottie_src -- -DQT_ADDITIONAL_PACKAGES_PREFIX_PATH=/target_qtdeclarative We expect the target QtQuick package to be found, but it won't be. The reason is that QT_ADDITIONAL_PACKAGES_PREFIX_PATH is added to the PATHs option, but we don't adjust CMAKE_FIND_ROOT_PATH. Without adding the new paths in CMAKE_FIND_ROOT_PATH, CMake will re-root the passed PATHs under the existing CMAKE_FIND_ROOT_PATH, which is QT_TOOLCHAIN_RELOCATABLE_INSTALL_PREFIX, which evaluates to /target_qtbase. There is no QtQuick package there. To fix this, prepend the values of QT_ADDITIONAL_PACKAGES_PREFIX_PATH to CMAKE_FIND_ROOT_PATH. The location where we currently do CMAKE_FIND_ROOT_PATH manipulations is in the qt.toolchain.cmake file, so to be consistent, we prepend the new prefixes there as well. We need to adjust both CMAKE_FIND_ROOT_PATH and CMAKE_PREFIX_PATH, due the path re-rooting bug in CMake. See https://gitlab.kitware.com/cmake/cmake/-/issues/21937 as well as the existing comment in qt.toolchain.cmake marked with REROOT_PATH_ISSUE_MARKER. We also need to do a few more things to make the setup work Because Qt6Config uses NO_DEFAULT_PATH, the CMAKE_PREFIX_PATH adjustments we do in the toolchain file are not enough, so we still need to add the same prefixes to the Qt6Config find_package PATHS option. One would ask why do we need to adjust CMAKE_PREFIX_PATH at all then. It's for find_package(Qt6Foo) calls to work which don't go through the Qt6Config umbrella package. To make the CMake re-rooting behavior happy, we need to ensure the provided paths are absolute. So we iterate over the values of QT_ADDITIONAL_PACKAGES_PREFIX_PATH, to make them absolute. We do the same for the environment variable. We need to append lib/cmake to the prefixes which are added to CMAKE_PREFIX_PATH, otherwise the CMake re-rooting bug is hit. We need to specify the Qt6 package location (${_qt_cmake_dir}) to the PATHS option in the various Dependencies.cmake.in files, to ensure that dependency resolution can jump around between the Qt6 dir and the additional prefixes. Previously the dependency lookup code assumed that all dependencies would be within the same prefix. The same is needed for qt and qml plugin dependency lookup. Amends 7bb91398f25cb2016c0558fd397b376f413e3e96 Amends 60c87c68016c6f02b0eddd4002f75a49ab51d4a8 Amends 5bbd700124d13a292ff8bae6045316112500e230 Fixes: QTBUG-95854 Change-Id: I35ae82330fec427d0d38fc9a0542ffafff52556a Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 6b6d42f6b814ab7814c795744fd6212b9b4d54fb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Pass Qt6_FIND_VERSION in Qt6Config when looking for componentsAlexandru Croitor2021-08-193-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | Pass Qt6_FIND_VERSION to components when the find_package(Qt6 ${ver} COMPONENTS Foo) signature is used. Create a ConfigVersion file for BuildInternals, so that BuildInternals passes the version check. Fix qt_configure_file to look in the _qt_6_config_cmake_dir folder for the template file rather than Qt6_DIR, because Qt6_DIR might be accidentally unset after a failed find_package(Qt6) call and the error is not helpful then. We already pass versions everywhere else when looking for dependencies, like in ModuleDependencies.cmake.in, PluginDependencies.cmake.in, ModuleToolsDependencies.cmake.in. Fixes: QTBUG-91737 Change-Id: Ief1da0c6f239c935385e7ce662951e85ccfdf130 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 654431286931a70645fc3be39570f9109c95fe9e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Don't backup cmake prefix when there are no tool dependenciesAlexandru Croitor2021-08-191-2/+2
| | | | | | | | | | This is just a minor optimization. Change-Id: Icf0fc615895e1def63c57a72694c89f7ae7ee5cf Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit d65ccd399929ae51f192655f23b521904767bbcf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove unnecessary version of module from _MODULE_DEPENDENCIESAlexey Edelev2021-08-191-1/+10
| | | | | | | | | | | | | | | _<module>_MODULE_DEPENDENCIES variable in the <module>Dependnecies.cmake should only contain the list of targets that module depends on, but not versions. Version of the first module appears in the list because of the regression introduced in 425ff34aa10a02524f2d52f544dc00b539ef9a26 Amends 425ff34aa10a02524f2d52f544dc00b539ef9a26 Change-Id: Iaa42120af6bac742bdf0f8d389bd8e5bdef9c1d1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 2059d294eb525fe23d1a7681a1563efb513fe31e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Don't install metatypes files for user projectsAlexandru Croitor2021-08-191-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Installing extracted metatypes json files for user projects was an oversight. We shouldn't install anything on behalf of user projects, but rather give them enough information so they can do it the themselves. Make all the install options of qt6_extract_metatypes internal, change the behavior not to install the files by default, unless __QT_INTERNAL_INSTALL is passed, which is used for the Qt build only. __QT_INTERNAL_NO_INSTALL is now a no-op and should be removed from projects. This is behavior change for existing public API, but it's better to fix this now before 6.2.0 release. Introduce a new OUTPUT_FILES option to allow assigning the extracted metatype file paths into a variable that the project provides. The project can then install the files where they need them. [ChangeLog][CMake] qt6_extract_metatypes does not install metatypes files anymore. Instead the OUTPUT_FILES option can be provided to get the list of extracted files for further processing. Task-number: QTBUG-95845 Change-Id: If5dd0255a5fea2b598e15118c29ec2ab2ba4324e Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e7455644a28e4d4b569a1f3fee421d9eeed00d3d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Include quiet packages in feature summaryAlexandru Croitor2021-08-181-1/+2
| | | | | | | | | | | | | This will show packages that were found (or not) with find_package(QUIET) in summary just before the configure summary. It's useful for CI logs to determine whether some Qt packages was not found when cross-compiling. Change-Id: Ic7d5062cf061f7c60b5c74374f957065dd8029f5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit a52b24ac39648b343555de7aff83ffa234958529) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Pick up *Tools components also from host QtKai Köhne2021-08-181-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | Let find_package(Qt6 COMPONENTS LinguistTools) for a cross-compiled Qt fall back to search LinguistTools in the host Qt. Use the same trick as in QtModuleDependencies.cmake: Prepend both CMAKE_PREFIX_PATH and CMAKE_FIND_ROOT_PATH with the QT_HOST_PATH (respective ${QT_HOST_PATH}/lib/cmake). Furthermore adding ${QT_HOST_PATH}/lib/cmake to PATHS argument makes sure that find_package will work even with NO_DEFAULT_PATH. Make sure not to match ShaderTools and Tools packages. ShaderTools is the cross-compiled package, the host package name is ShaderToolsTools. Tools is the cross-compiled module from qttools. Allow an opt out via a QT_NO_FIND_HOST_TOOLS_PATH_MANIPULATION variable in case that we accidentally match more packages ending in Tools that are actually cross-compiled packages. Fixes: QTBUG-95602 Change-Id: Ib0a787716fa529e36f22356da069e705d9eed5fa Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit d2359b2d4e5db6c42158d536d6e2a2af5ea1e59c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* configure: Fix iOS option to be passed for both platform and xplatformAlexandru Croitor2021-08-171-1/+3
| | | | | | | | Task-number: QTBUG-95838 Change-Id: If0617e1d9c47595d4a350a91ab4f7d47546ebf08 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 3d2dc88850b6ba030238791dcd4a4ec44bb2479d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Save value of QT_UIKIT_SDK in QtBuildInternalsExtra.cmakeAlexandru Croitor2021-08-171-0/+5
| | | | | | | | | | | | | | | | The value of QT_UIKIT_SDK is used in configure tests via qt_config_compile_test -> qt_get_platform_try_compile_vars. Up till now QT_UIKIT_SDK was only available in qtbase only. Save the value in BuildInternals to ensure it's used for other repos as well. Change-Id: I46f372267782f1c8e7d48c237fe0264ac72d33bb Task-number: QTBUG-95838 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 67dae9e6ee1c17cbdbfd015b43e27a41a8040409) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>