summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Fix framework headers not being copied after rm-ing build dirAlexandru Croitor4 days1-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | If a build dir is removed using rm -r *, this still leaves dot files around, specifically the .ninja_log file. Because of a possibly unspecified behavior of listing directories as OUTPUTs in a add_custom_command call for the ${target}_copy_fw_sync_headers custom target, we end up with a situation where the custom command is not rerun by ninja because the directory OUTPUT was encountered in the .ninja_log file. Make sure to specify an additional file as an OUTPUT, to ensure the command does rerun, and thus copies all headers from the syncqt staging directory. Amends 103eca1070a75bfa97d0b72b94e0c759ef0bcd1c Pick-to: 6.5 Fixes: QTBUG-126056 Change-Id: I5664cf074158199e0c7fd5e312ecf739133d7f2e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit c561bcceed0300a14e2062958afce62776be4b6f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 92ffa3a7a57fdc88721f9578f83cf02fe8b48732)
* Prefer using the non-suffixed libzstd over static oneAlexey Edelev12 days1-1/+4
| | | | | | | | | | | | Recent zstd versions provide the libstd target but not only libzstd_shared or libzstd_static. Attempt to use it as the WrapZSTD::WrapZSTD counterpart if the target exists. Task-number: QTBUG-119469 Pick-to: 6.5 Change-Id: I47916bfa6f10883d099184a497800277c8026b14 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 7d9d1220f367d9275dfaa7ce12e89b0a9f4c1978)
* CMake: Fix configs passed to qt_get_install_target_default_argsAlexandru Croitor13 days2-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because the configs passed to the ALL_CMAKE_CONFIGS option were quoted cmake_parse_arguments(PARSE_ARGV) would escape the semicolon in the set value, effectively doing set(arg_ALL_CMAKE_CONFIGS "Release\;Debug") Then the list(GET arg_ALL_CMAKE_CONFIGS 0 first_config) call would essentially do set(first_config "Release;Debug") and the if(all_configs_count GREATER 1 AND NOT arg_CMAKE_CONFIG STREQUAL first_config) condition would never trigger because a single config string can never equal a double config string. Remove the quotes to ensure correct behavior. This won't really trigger any behavior change, because we exclude installation of Debug executables in -debug-and-release builds, but it will make --trace-expand logs less confusing. Amends f240d94f140ba1614828804efafd2fc5e6d00099 Change-Id: I53179511c7698c90b33cb3ff2762cef680a99815 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit a1445670f5860398b475ad8ed87ba0629275499e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix DEBUG_POSTFIX to apply to macOS multi-config buildsAlexandru Croitor2024-05-221-0/+1
| | | | | | | | | | | | | | | | | | | | There was refactoring in 8c41125118768ce037698e0605755128b2da705d to handle custom postfixes, which caused a regression in the postfix not being set for macOS frameworks. Specifically we set CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_DEBUG to the value of ${${postfix_var}} but that variable was empty, because we only set it in the PARENT_SCOPE. Set the variable also in the current scope. Amends 8c41125118768ce037698e0605755128b2da705d Pick-to: 6.5 Change-Id: Iae3f1050bb11805b4cce01ec491a13a3d6c0a9fc Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 6328aaadf9683089aaa3904ea1cec56012d6212e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Consider the versioned Qt6::Gui when target when adding the plugin dependenciesAlexey Edelev2024-05-201-1/+2
| | | | | | | | | | | QtGui module can be linked using both versioned and non versioned targets. Consider this when adding the dependencies to the qpa_default_plugins targets. Change-Id: Iccbf3009ab8a4f9df4de1677f1b41445814c8c9e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 1e8a36e360d7e86b86db7ba7a7cc258f65348929) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Suppress package not found warnings in some FindWrap scriptsAlexandru Croitor2024-05-144-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | Some of our FindWrap scripts try to call find_package() once or more to find a system package, and then fallback to a different source in case if not found. The side effect of this is that find_package() will append not found packages to the global PACKAGES_NOT_FOUND property. FeatureSummary feature_summary() will then list these as not found, creating confusion. For example while FindWrapSystemPCRE2 might be found, PCRE2 found will be shown as not found, because we found the package via PkgConfig instead of cmake Config file. Manually remove these packages from the PACKAGES_NOT_FOUND property in some of our Find scripts, to avoid the confusion. Fixes: QTBUG-96120 Task-number: QTBUG-96394 Task-number: QTBUG-111216 Change-Id: I4be825c810248202c34f446e3cebe66574d0531c Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 70a2e7f32b9f9ce19d1538f14fbde7b0d1e77ffd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Propagate ZLIB version in Find script to wrapper scriptAlexandru Croitor2024-05-141-1/+9
| | | | | | | | Pick-to: 6.5 Change-Id: Ieba03d792b5a21c7a101e3034831475d22fd9814 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit aec74f9c767b979dbe488f48e311fe4d04413edc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Prefer the versioned targets over the namespaceless one when collecting depsAlexey Edelev2024-05-071-5/+5
| | | | | | | | | | | | | | | Change the way we collect dependencies in __qt_internal_walk_libs. Prefer the versioned Qt targets over the namespaceless. This fixes the generating of the pkg-config configs. Pick-to: 6.6 6.5 Task-number: QTBUG-124135 Change-Id: I660376e122a99b5bc0874f2bc6ccd4d80c9ad453 Reviewed-by: Ionen Wolkens <ionen@gentoo.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit ac4920b5c0a537ede62dcef76a32311a497c68e1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Consider versioned targets when checking the existens in __qt_internal_walk_libsAlexey Edelev2024-05-071-2/+2
| | | | | | | | | | Since Qt targets now are linked as versioned targets by default, we should adjust the respective check in __qt_internal_walk_libs. Change-Id: Idb896c1d9eda944a06d57b0491686cd78e010df0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 721cfbd1942f8148dd464c0542b0d4c1191b53f9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Consider '^Qt6' deps when generating pkg-config filesAlexey Edelev2024-05-071-1/+1
| | | | | | | | | | | | | Dependencies that alredy start with QT_CMAKE_EXPORT_NAMESPACE shouldn't be skipped but collected as is when generating pkg-config files. Pick-to: 6.6 6.5 Fixes: QTBUG-124135 Change-Id: I6875337c2e1d98f657e52a5fc2c37eebccf08b98 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 337cadbcb7900d78505b25e66555b853d2c2c707) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: remove QT_EDITION from qconfig.priAntti Kokko2024-04-261-2/+0
| | | | | | | | | | | | | | | | | QT_EDITION is not used anywhere in Qt6, stop adding it to qconfig.pri. Packaging currently unnecessarily patches the edition when handling the first steps after integration and again during install time. Pick-to: 6.5 6.2 Change-Id: I0ad1933ec8fea741796fdf6d13f627a657aac401 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> (cherry picked from commit d04deafed932d955e2e94324ec5b1a261fdb3332) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: add licenseRule.json to IDE projectsTim Blechmann2024-04-241-1/+4
| | | | | | | | | | Some repos have licenseRule.json files. Adding them to the IDE projects. Change-Id: I7fdc054d244d48e3343866775671d8f4f4c9390b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Lucie Gerard <lucie.gerard@qt.io> (cherry picked from commit 7a62c962383b6a069c6955f57173a0f1001c4461) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* cmake: Add opt-out for adding -no_warn_duplicate_libraries linker flagTor Arne Vestbø2024-04-191-1/+2
| | | | | | | | | | | The classic linker (triggered via -ld_classic) doesn't support this flag, and we can't construct a genex that takes this into account, so add an opt-out for Qt WebEngine. Change-Id: I62418e0ff37fe8f5bdda2fa8d01b36a8fd44542a Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit b74369c03325e49132dc77f2a83af8fd25c81a8a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: qt_internal_add_test - fix BLACKLIST file handlingTim Blechmann2024-04-161-4/+4
| | | | | | | | | | Not all tests have targets that we can attach the BLACKLIST files to. Change-Id: Ie0a2d72859877a8803802a4f7dc996944f002656 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit edc2d414562ece8b139b1cd1fcf77df245d0573f) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: qt_internal_add_test - add BLACKLIST files to IDE projectsTim Blechmann2024-04-161-0/+5
| | | | | | | | | | Tests can be blacklisted via BLACKLIST files. This patch adds these files to the generated IDE projects automatically when available. Change-Id: Icef2c397ada823e7b1c380dbb224694f059891ff Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 191dbbdea7151ca7177174f2de74b8279a7b12d4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: split _extra_files targetsTim Blechmann2024-04-141-12/+57
| | | | | | | | | | Separate config.tests, coin, cmake, licenses and changelogs into independent targets to keep the IDE projects more organized. Change-Id: Ie33d45799621c2d7ec6f022ffcfac132ac4c7b94 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit bd2dc0c3ed750eca9a3b87f1f99069a2d4e954f8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* cmake: add _extra_files IDE target from heuristicsTim Blechmann2024-04-141-0/+57
| | | | | | | | | | | | Lots of files in the repos are not included into the generated IDE projects. Therefore we add utility targets (custom targets), which are populated by glob patterns, which should fit most files that are found in qt's subprojects. Change-Id: I1b731e65f8db319d3cec817eea5c23a1eeaefb22 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 003a19115279e44bf8af96e0f588f5cc34725353) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Suppress the warning about unused QT_INTERNAL_CALLED_FROM_CONFIGUREAlexey Edelev2024-04-111-1/+3
| | | | | | | | | Add the dummy check if the variable is defined to suppress the warning. Change-Id: If3bb0ef6a2587693c0ec898ceb3080ebfc1e82a7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 6760bae2fa7a758ac8eb70c0009c80a715ea1c54) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix a misplaced > in pkg-config filesMartin Storsjö2024-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Qt CMake routines for generating pkg-config files don't handle all sorts of generator expressions, see qt_internal_set_pkg_config_cpp_flags in QtPkgConfigHelpers.cmake which hardcodes handling of some specific expressions. In this case, they don't handle the semicolon within the generator expression expansion. For the UNICODE and _UNICODE defines, this means that the pkg-config file ends up containing "-D_UNICODE>" with the trailing ">". (The pkg-config generator tries to parse out the generator expressions, but the semicolon gets handled as a higher level separator, leaving the closing bracket ">" behind.) This issue only shows up for mingw targets, because pkg-config files aren't generated in MSVC style builds. Escape the semicolon as $<SEMICOLON> to make it not break the surrounding generator expression, as parsed by the pkg-config file generator. The generator expressions aren't fully correctly evaluated for the pkg-config files though; the UNICODE and _UNICODE defines don't end up in the resulting pkg-config file even though they're used during compilation (both before and after this change). Fixes: QTBUG-103019 Co-authored-by: Martin Reboredo <yakoyoku@gmail.com> Pick-to: 6.5 6.2 Change-Id: Icdb380e3b42be2a47372a8ee2b61378a33c685f7 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Li Xinwei <1326710505@qq.com> (cherry picked from commit f35b9530b9acf954f8741d0ee2b4b68fc90a4afc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid using PACKAGE_PREFIX_PATH for configure-time executablesAlexey Edelev2024-04-111-5/+18
| | | | | | | | | | | | | | | PACKAGE_PREFIX_PATH is not defined in cmake versions 3.29.x. We should avoid referring the internal CMake variables. Use the calculated reverse relative path to the prefix path instead. Fixes: QTBUG-124186 Pick-to: 6.6 6.5 Change-Id: Iefae132e61a3f8e8f5525c0abd6a2d41631c2fb0 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 2d19f09b577f72290328d90ba85145362676ea92) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* cmake: Only enable warnings on/off flags for C/C++/Objective-C/C++Tor Arne Vestbø2024-04-071-2/+9
| | | | | | | | | The flags are not valid for e.g. Swift Change-Id: Ie5b46dc9147d8c024e7e27712c7b8632abd727d9 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit ce23c9083f4d06054eb59781c3309b1fcc807a1f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Set the CMP0159 to NEW where applicableAlexey Edelev2024-04-072-0/+8
| | | | | | | | | | | The policy controls the file(STRING ... REGEX) behavior. This suppresses warnings produced by CMake versions >= 3.29. Pick-to: 6.6 6.5 Change-Id: I6067bb719b7d35aa2464a91ed198399ff9b1c9af Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 4fcf6f5164be0c7cdc56b0a37dcadc42fac4f344) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* cmake: Selectively enable -no_warn_duplicate_libraries for Xcode 15+Tor Arne Vestbø2024-04-031-9/+9
| | | | | | | | | | | | | We can't make the choice of whether to enable no_warn_duplicate_libraries or not based on the Xcode version Qt was built with, as the target flags will propagate to our cmake integration tests, which we run on platforms where we don't have Xcode 15. Change-Id: I241a950a3d2e70652a3a6386e5dd86c681d1c13f Reviewed-by: Kai Köhne <kai.koehne@qt.io> Reviewed-by: Orkun Tokdemir <orkun.tokdemir@qt.io> (cherry picked from commit 2e97906593bca028e5a173264c05edb18427381f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake/ELF: allow using Qt's full version number in the private tagsThiago Macieira2024-03-221-1/+5
| | | | | | | | | | | | | | | | | | | | | We added the feature to tag private symbols using the Qt major version only, because us developers often move between versions and need to keep compiled code working, even when using private API (we're supposed to know what we're doing). Linux distributions, however, want to be told that something used private API and therefore needs to be rebuilt. See [1][2][3]. Distributors will learn about this feature when updating Qt causes the existing patch to fail to apply. [1] https://build.opensuse.org/projects/openSUSE:Factory/packages/qt6-base/files/0001-Tell-the-truth-about-private-API.patch?expand=1 [2] https://src.fedoraproject.org/rpms/qt6-qtbase/blob/rawhide/f/qtbase-tell-the-truth-about-private-API.patch [3] https://github.com/clearlinux-pkgs/qtbase/blob/main/tell-the-truth-about-private-api.patch Change-Id: I5f663c2f9f4149af84fefffd17bed69026f4038d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit e0940081bc7439d87d9ca41402a543a9c17fb857) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Reconfigure whenever module EXTRA_FILES are touchedAlexandru Croitor2024-03-221-0/+3
| | | | | | | | | | Otherwise the touched files will not be re-copied and re-installed until an explicit rerun of cmake. Change-Id: I5abb752b45d8b33885a59363fe987225a89e713a Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 07e7340c0d82a33b7b112cb7c3a2a719ad2ec9c3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Allow configuring a minimal subset of examples to deployAlexandru Croitor2024-03-202-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | When building examples as part of Qt in the CI, it's best to skip running deployment for all examples to save resources (space and time). Add a QT_DEPLOY_MINIMAL_EXAMPLES option similar to our QT_BUILD_MINIMAL_STATIC_TESTS option, which will set QT_INTERNAL_SKIP_DEPLOYMENT at the root examples directory scope, to skip deployment for all examples. Each example can then opt into the minimal subset by unsetting the QT_INTERNAL_SKIP_DEPLOYMENT variable before its qt_internal_add_example call. Add Coin instructions to enable this option when building our examples in the CI. Task-number: QTBUG-90820 Task-number: QTBUG-96232 Task-number: QTBUG-102057 Change-Id: I2efcda455b400c27fe1efd1bcf81b133137fa2d1 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 224b7c6b6a2a425487df19643709d105e8f3cdd5) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* coin: Add instructions to build standalone examplesAlexandru Croitor2024-03-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | If a qt5.git configuration is marked with the StandaloneTests feature, tell CMake not to build the examples in-tree, and instead use qt-internal-configure-examples to build the examples out-of-tree. This brings a couple of improvements: - higher chance of building examples as ExternalProjects without issues - ability to use deployment api in examples, without installing the examples into a main install prefix The new coin instructions files use a copy of the standalone tests instructions as a base. Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: If89e6da0b327a38b9c2738f58aa1b5b5fb9fda37 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit d644f2e02ce36520b4d101ea03fbbcf1b72e7e6f) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Fix finding standalone parts config file for yoctoAlexandru Croitor2024-03-201-1/+9
| | | | | | | | | | | | | | | | | | | | | | When building standalone tests of qtsvg targeting yocto, the standalone parts config file was not found. That's because it specifies a new CMAKE_STAGING_PREFIX for each built repo, and the QtSvgTestsConfig.cmake file will be located there, rather than in QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX, where the QtBuildInternalsConfig.cmake file is. So in this case, we always have to prefer looking into CMAKE_STAGING_PREFIX for the file. Amends 62905163bf887c2c2c9ba7edcd64c96d237a6e95 Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: I8902381afa4267e40dfb2ad47e44285a806a35e2 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 270315e019a569bebf83e7c293b44f36c555fb3c) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Allow building all examples as standalone just like testsAlexandru Croitor2024-03-2012-96/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new libexec/qt-internal-configure-examples script that allows to configure and build "standalone examples" just like "standalone tests". This is a prerequisite for using deployment api in examples for prefix builds, otherwise deployment api gets confused not finding various information that it expects from an installed qt. Because the various conditions in the build system for standalone examples are similar to standalone tests, introduce a new QT_BUILD_STANDALONE_PARTS variable and use that in the conditions. The variable should not be set by the user, and is instead set by the build system whenever QT_BUILD_STANDALONE_TESTS/EXAMPLES is set. Unfortunately due to no common file being available before the first project() call, in qtbase builds, per-repo builds and top-level builds, we need to duplicate the code for setting QT_BUILD_STANDALONE_PARTS for all three cases. Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: Ia40d03a0e8f5142abe5c7cd4ff3000df4a5f7a8a Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 62905163bf887c2c2c9ba7edcd64c96d237a6e95) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Adjust QT_ADDITIONAL_QML_PLUGIN_GLOB_PREFIXES for EP examplesAlexandru Croitor2024-03-201-0/+17
| | | | | | | | | | | | | Make sure to consider all qt_prefixes for adjusting QT_ADDITIONAL_QML_PLUGIN_GLOB_PREFIXES with locations where qml plugin config files might be present. Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: I5a7eec434635db1953871d735e2420c331ccee48 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 06fef6219e992489dae15e9851725e1675ff0bf6) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Allow specifying additional glob paths for QmlPlugins.cmakeAlexandru Croitor2024-03-201-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we hard-code to look for qml plugin Config.cmake files in the current list dir, whether the Qt6Qml directory is. This is not sufficient for finding qml plugins in a prefix build of a repo that has not been installed yet. For example qtquick3d plugins will be in qtquick3d_build_dir/lib/cmake/Qt6Qml/QmlPlugins, which won't be picked up by the Qt6Qml Config file in the installed Qt location. Allow specifying extra qml plugin glob prefixes via a new QT_ADDITIONAL_QML_PLUGIN_GLOB_PREFIXES variable. This is similar to QT_ADDITIONAL_PACKAGES_PREFIX_PATH. Any path specified via QT_ADDITIONAL_QML_PLUGIN_GLOB_PREFIXES will have the QmlPlugins/${INSTALL_CMAKE_NAMESPACE}*Config.cmake glob appended to it, and then used for globbing files in that location, after processing the main location wherever Qt6Qml is. This will be used by ExternalProject example machinery. Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: I469863c965b8b13cf007c611976a64fbff6e9111 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 40fa36db22b67363a4a05a4d74b0fcfc2f4833b8) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Disable ExternalProject examples for -debug-and-release buildsAlexandru Croitor2024-03-201-1/+5
| | | | | | | | | | | | | | | Unfortunately when using CMake <= 3.27 together with -debug-and-release, it's not possible to reliably build examples as external projects due to clobbered files in the same build dir. Disable building examples as EPs in such a case. Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: Icea9fdab47986c2608e1952a0bbae72365ac7a62 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit c668dd4044283b6eac86f7ab8177595e207567d7) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Adjust CMAKE_MODULE_PATH for ExternalProject examplesAlexandru Croitor2024-03-201-0/+6
| | | | | | | | | | | | | | | | | | When building EP examples for a repo that defines a bundled library, we need to make sure the relevant FindWrapBundledFooConfigExtra.cmake file is found when looking up dependencies. For a prefix build, that file is placed in the build dir of the repo. Use the list of qt_prefixes that includes the build dir of the repo, append lib/cmake/Qt6 to it and pass that as additional values to the CMAKE_MODULE_PATH variable of the external project. Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: I85d5f360380856fcfb8be7235b8365dcf15aa0c0 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 31c5d50e84b210843ccdec58a86c4fce3125b679) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Fix syncqt IMPORTED_LOCATION path for multi-config buildsAlexandru Croitor2024-03-202-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building examples as ExternalProjects as part of a multi-config qtbase build, syncqt can not be located with the following error: CMake Error at Qt6CoreToolsAdditionalTargetInfo.cmake:10 (message): Unable to add configure time executable Qt6::syncqt qtbase/libexec/syncqt doesn't exist Call Stack (most recent call first): qtbase/lib/cmake/Qt6CoreTools/Qt6CoreToolsConfig.cmake:44 (include) qtbase/cmake/QtPublicDependencyHelpers.cmake:65 (find_package) qtbase/lib/cmake/Qt6Core/Qt6CoreDependencies.cmake:34 (_qt_internal_find_tool_dependencies) qtbase/lib/cmake/Qt6Core/Qt6CoreConfig.cmake:42 (include) qtbase/lib/cmake/Qt6/Qt6Config.cmake:165 (find_package) CMakeLists.txt:13 (find_package) The Qt6CoreToolsAdditionalTargetInfo.cmake file is used both for install(EXPORT) Config files as well as export(EXPORT) Config files, and in the latter case, the path that syncqt is looked up in is not correct because syncqt is not yet installed. In addition to checking whether syncqt exists in the install path, also check if it exists in the build dir. Ideally the additional path would be stored in a separate file that is not installed, but the current code infrastructure does not provide such a feature. Because we store a relative path instead of an absolute path, the build path does not leak, so the situation is bearable. Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: I16ad5c280751e050bc9b039ebd38ec9a66a6554c Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit cc537d927b23a34296767fec8d3885a95f714255) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Pass CMAKE_MODULE_PATH to external project examplesAlexandru Croitor2024-03-201-0/+1
| | | | | | | | | | | | | | | | | | | | | Some examples depend on FindWrapFoo.cmake scripts that are part of a repo. An example is qtgrpc with FindWrapProtoc.cmake. These need to be available when building external project examples in a prefix build where the repo is not installed yet, and thus the source dir FindWrap scripts need to be used instead. Make sure to pass the value of CMAKE_MODULE_PATH to the external projects to ensure these scripts are found. CMAKE_MODULE_PATH is populated by qt_set_up_build_internals_paths as part of the qt repo build. Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: I3e977919bc137ed60e8eb9300625e5d8b87b373e Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 20bd9fad1cf6d41c773056949e334c3ab75e8b1c) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Allow passing extra variables to external project examplesAlexandru Croitor2024-03-201-1/+9
| | | | | | | | | | | | | | | | | | | | In some repos we need to be able to pass extra cache variables to find 3rd party packages when building examples as external projects. Introduce QT_EXAMPLE_CMAKE_VARS_TO_PASS to allow passing vars like OpenSSL_ROOT or Protobuf_ROOT if they are set in the repo project. It should be noted that QT_EXAMPLE_CMAKE_VARS_TO_PASS expects a special syntax for its values, of the from VAR_NAME:CMAKE_TYPE, due to the pre-existing implementation on how we pass variables to ExternalProject. Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: Ie3e74d4fde106f947d12e51d27e41a310157aab6 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 43d0c5ed6ef666b4ef9f33c018240f551fb6ebae) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Recompute QT_DEPLOY_PREFIX for each built exampleAlexandru Croitor2024-03-191-0/+2
| | | | | | | | | | | | | | | | | | | | The current deployment api implementation sets the value of QT_DEPLOY_PREFIX based on CMAKE_INSTALL_PREFIX, if no QT_DEPLOY_PREFIX was previously specified. This does not work properly when multiple examples are placed in the same subdirectory and are using deployment api. Make sure to unset the QT_DEPLOY_PREFIX for each qt_internal_add_example call, so that a correct prefix is computed for each example, based on the modified CMAKE_INSTALL_PREFIX value that we set for each example. Task-number: QTBUG-102057 Change-Id: I931e5f2d683ab94a940e20a2bdfeaa4ac5d8c5f8 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit c5d0e93199beea314e4e4607c8ef5f7c29162666) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* cmake: Propagate Apple platform build requirements to qconfig.priTor Arne Vestbø2024-03-191-2/+17
| | | | | | | | | | | | | So we don't have to maintain the requirements in two places. None of the variables removed from the qmake configs are referenced before we do load(qt_config), so this should be safe. Change-Id: Iabd5884a2fd1c4b1cd7b44416bebb2624050229e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 640a3f24741dbd50cc5aff425c81d09f908054b4) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Correct license for qbatchedtestrunner.in.cpp fileLucie Gérard2024-03-151-1/+1
| | | | | | | | | | | | | | | File is is part of the internal test infrastructure. According to QUIP-18 [1], all test files should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Task-number: QTBUG-121787 Change-Id: Ia5bc4e0abeea210ee501596330b2b63216e9e9c7 Reviewed-by: Kai Köhne <kai.koehne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 0886035bcdd7bb1c74d3119354d1311377ebc0dd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Move most of CMakeLists.txt into QtBaseHelpers.cmakeAlexandru Croitor2024-03-141-0/+206
| | | | | | | Change-Id: I19761dbeebdd2529ef0c493a9a61a1c6fe58667b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit d298a05ed1f86d4789c81877990dfd8965457d74) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix the condition for creating of the plugin init target aliasesAlexey Edelev2024-03-141-1/+1
| | | | | | | | | | | | | Make sure that plugin_init_target is not empty. It's empty when creating qml plugins. Amends 566b726b8400d473861a62b4b9de87d1f0958d6d Change-Id: If23998d50d8d31e20b3966730afb8b4b46b9990c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit e7d7eded4ce64896d98dbc92ac1c1f21aae52b06) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Collect CMAKE_MODULE_PATH from QT_ADDITIONAL_PACKAGES_PREFIX_PATHAlexey Edelev2024-03-132-0/+18
| | | | | | | | | | | | | | | | | This is sensitive for the 'include' calls that expect cmake scripts to be found in some staging prefixes. In yocto QT_ADDITIONAL_PACKAGES_PREFIX_PATH points to the package image path(installation snapshot). If repo provides bundled 3rdparties the 'include' statement that includes 'FindWrap<3rdparty>ConfigExtra' is unnable to locate it, since it's expected to be found in Qt installation, but the file didn't land there at ptest stage. Fixes: QTBUG-122205 Pick-to: 6.6 6.5 Change-Id: Idd03f44efd2e3fdaa476873068c73ac28cd0a7b5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 8db0a12e84075e0e41f6a92027df74fe2b2d2182) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Create alias targets for plugin init targetsAlexandru Croitor2024-03-121-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When building tests in-tree targeting iOS, we run _qt_internal_finalize_executable via qt_internal_add_test_finalizers. This in turn calls __qt_internal_apply_plugin_imports_finalizer_mode which tries to link to versioned plugin int targets. Because the linked plugin init target is built in-tree as well, and did not have versioned alias targets created, configuration fails with: Target "tst_baseline_qsvgrenderer" links to: Qt6::QSvgIconPlugin_init but the target was not found. Make sure to create versioned alias targets for the plugin init targets. Amends 6c9f4f5ebcd35dc1a68c442d9fbf3ec48f30baca Fixes: QTBUG-123186 Task-number: QTBUG-122181 Change-Id: I0048b724d465dc3c176d238d144feb072262d76e Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 566b726b8400d473861a62b4b9de87d1f0958d6d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Change license for .in filesLucie Gérard2024-03-0819-0/+59
| | | | | | | | | | | | | | | According to QUIP-18 [1], all build system files should be BSD-3-Clause. The files in this patch are part of the build system. [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7.0 Task-number: QTBUG-121787 Change-Id: Ibc6a60a9b009fab0c953e8e3269533c121e4511e Reviewed-by: Kai Köhne <kai.koehne@qt.io> (cherry picked from commit bf1e76408e07ac175ee467c5095e88209d9a6ba8) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Realign columns in the configure-cmake-mappingGiuseppe D'Angelo2024-03-081-2/+2
| | | | | | | | Change-Id: Ie7c3c35b6e5a8d02d05650b86f6c2d47b72c3835 Pick-to: 6.6 6.5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 9069b7fb20fe46f6e7b74c23d052274a8c5cf8dc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* configure-cmake-mapping.md: add -qt-host-path and -DQT_HOST_PATHMitch Curtis2024-03-081-0/+1
| | | | | | | | Pick-to: 6.6 6.5 Change-Id: I6deb7b648c39adb8fb2765de5be29b0743ef2836 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit d130886997575ee1ffc20bfcfb6344526ca28533) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Don't add default rpaths to qt qml plugins when requestedAlexandru Croitor2024-03-061-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | qt_add_qml_plugin has code to set a sensible install rpath for user project qml plugins. If Qt was configured without rpath support, we should not add any rpaths to qt qml plugins: - qt-computed rpaths added by qt_apply_rpaths - user-project rpaths added by qt_add_qml_plugin This is done by setting QT_NO_QML_PLUGIN_RPATH to TRUE as part of QtSetup, effectively applying the option to any qml plugin that is built by internal qt api. User projects will still be able to use the default rpaths added by qt_add_qml_plugin, even if qt itself was configured with no rpath support. Fixes: QTBUG-122687 Change-Id: I8178b527553dd00436d0abb3b44061ea16edc121 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 375f3869308fd01c276b17581ef827583550dba3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix assignment in internal_get_build_vars_for_external_projectsAlexandru Croitor2024-03-061-2/+2
| | | | | | | | | | | | | | The check and variable name were incorrect after a refactoring. Amends ba9623860056cbb75e426e27905f9c29b687cefa Pick-to: 6.6 Task-number: QTBUG-84884 Task-number: QTBUG-90820 Change-Id: I33b6b81695a6352c7869ef6186e00881b47bd6f3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit aacc31815d40c8f5dbdd998536fb1fcd5f632221) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: add options to not generate target wrappersSamuli Piippo2024-03-061-1/+1
| | | | | | | | | | | | The target wrappers for qmake and qtpaths do not work on Yocto builds and only create confusion when they are available in target. Add option to disable their generation. Task-number: QTBUG-122420 Change-Id: Ibb829cc846ad6c470fe29e746ade42fccaa33a6f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 762c56d65bf2bf430621f6bed8f6d96ee333e718) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* cmake: Allow silencing CMake generator warning from environmentTor Arne Vestbø2024-03-051-1/+2
| | | | | | | | Pick-to: 6.6 6.5 Change-Id: I13d3000121be39f204b4374118690fe27702dd12 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 5736e0b65599f2e3dedcb80ec88ecc431a459d38) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>