summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
...
* CMake: Rename FindZSTD to FindWrapZSTDAlexandru Croitor2022-03-021-16/+18
| | | | | | | | | | | | | And the target ZSTD::ZSTD to WrapZSTD::WrapZSTD. This should allow building Qt with the -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON set. Fixes: QTBUG-100537 Change-Id: I748601e4ad6f518323bf1034d6fc1de582c815e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 34a4fe01663c3d8b193e42c6609e75c431f8a897) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add the _qt_internal_android_executable_finalizer wrapper functionAlexey Edelev2022-03-021-4/+2
| | | | | | | | | | | | | _qt_internal_android_executable_finalizer wraps Android-related function that are needed to created an Android package. The function is added to the INTERFACE_QT_EXECUTABLE_FINALIZERS property in Qt Core so it's called implicitly for user projects. Change-Id: I140f53341691dcfdc6ae2ddea520818cf2834eb6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit e7586119e1ba48844a9353e5b9cb6f0f26292764) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* configure: CMake: Add -no-prefix optionAlexandru Croitor2022-02-253-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new -no-prefix option that can be used to build Qt without having to install it. Currently, -no-prefix is already implied by -developer-build, but -developer-build also implies -warnings-are-errors and -feature-private-tests, which not everyone might want to use. Some Qt builders likely use -developer-build for the no-prefix behavior, hence we introduce a standalone -no-prefix option to offer a nicer user experience without -Werror and friends. Previously it was possible to achieve the same by specifying -prefix $PWD, but that relies on $PWD expanding property in the used shell. The new -no-prefix doesn't depend on the type of the shell and is shorter to type. Internally this gets passed by configure as -DINPUT_no_prefix=yes to CMake, and transformed into a -DQT_FEATURE_no_prefix=ON feature. The feature also gets automatically auto-detected to ON if developer-build is set, -prefix is either unset or $PWD. CMake code should still query QT_WILL_INSTALL to decide whether files need to be installed or not. As a drive-by, we now also export QT_FEATURE_developer_build to be available for querying during configuration of other repos (previously it was only possible to query FEATURE_developer_build). Change-Id: Iaa6c8d8ae2b736282e9949d2a5d7f412e290a253 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io> (cherry picked from commit 32b596b7b10eac63293cf3bd3e04a15bd826fbf1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Read QT_HOST_PATH from the environment tooJoerg Bornemann2022-02-252-5/+12
| | | | | | | | | | | | For cross-compiled conan packages we need conan to export QT_HOST_PATH as an environment variable. The Qt build now picks up this environment variable if no QT_HOST_PATH cache variable was specified. Change-Id: I0c3e15e82842061d5db81949ffcc1c240f6ed6a4 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 599c648b77628fe195e78d6e7ac145f258f8880b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Forward QT_ADDITIONAL_(HOST_)PACKAGES_PREFIX_PATH to try_compileJoerg Bornemann2022-02-251-0/+2
| | | | | | | | | | | All variables that are used in qt.toolchain.cmake should be recorded in __qt_toolchain_used_variables. This is mostly done for consistency and to avoid surprises in future configure checks. Change-Id: I1ae18c5dfe9677c5f46a102e434e32187cb0d703 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 27bd7e0093da00fcf425986bd1f58cdbfca1fe42) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix the mapping between configure arguments and CMake variablesAlexey Edelev2022-02-241-3/+3
| | | | | | | | Fixes: QTBUG-101172 Change-Id: Ie1e01880911e771eedbf29b0d2d0607bc25b0549 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit bb209b5715538b3994506b4428777114791a8e26) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QT_ADDITIONAL_(HOST_)PACKAGES_PREFIX_PATH environment variablesJoerg Bornemann2022-02-232-2/+12
| | | | | | | | | | | | | | | | | | Except on Windows, the values in CMake environment variables that contain path lists are separated by colons, not semicolons. See documentation of CMAKE_PREFIX_PATH. This is necessary for conan's virtualenv generator which sets these environment variables with native list separators. This amends commit e044c94a61f0cd2bdea1e89be4ec3c68007f7a5c. Task-number: QTBUG-94524 Change-Id: I7f3d140a8462347b181f1d9601fd11cc1ba449db Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 71d011d35ace2948edf07b0c475100681ea075fd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix exclusion of QtFoo in QtBarDepends for 3rd party libsAlexandru Croitor2022-02-233-22/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When configuring a static Qt with the -qt-zlib option and the build system creates a 3rd party header module QtZlib, syncqt does not generate a QtZlib header file that would include all its public headers. Then when the QtSvgDepends header is generated, it would add an #include <QtZlib> which would break compilation of the QtSvg PCH file (which compiles QtSvgDepends). We have logic to exclude addition of headers from regular 3rd party static libraries, but not header only 3rd party libraries. Adjust the code to handle header-only 3rd party libraries, as well as make sure it works across repos by exporting the relevant properties. As a drive-by, also rename and export some other informational properties. Amends af00402d6446c0f8f085a2a482fc83c4318aa457 Amends 6fdeaea24f9035ad53ba2548a9467b3264cf01ad Amends be2745e4788cecb0d3122081e3328e4b66923609 Change-Id: I087f50b193dd845e4a5ec906e8851d63122faf80 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 56abd7e4e0ac4a382df01575446138809d031da5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Add INSTALL_DIR argument to qt_internal_add_appJoerg Bornemann2022-02-231-3/+10
| | | | | | | | | | | | | | | Add the possibility to install a Qt app into a directory different from ${INSTALL_BINDIR}. If INSTALL_DIR is not specified, qt_internal_add_app still installs to ${INSTALL_BINDIR}. Task-number: QTBUG-99295 Task-number: QTBUG-100047 Change-Id: I52371aa0f770d80c32bb0b3442ce3c463916be63 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit d48609a9c41643d6fdb0a964fa3209fe1a175a11) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* wasm: move user configurable settingsLorn Potter2022-02-231-25/+0
| | | | | | | | | | | | Both INITIAL_MEMORY and PTHREAD_POOL_SIZE are settings users can change, they are not interface settings. Fixes: QTBUG-100693 Change-Id: Ie1547c7f52c9fe109a313260616705728024b6b8 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: David Skoland <david.skoland@qt.io> (cherry picked from commit af36dc7d763abcd4a5de28957f55cecd25cf8459) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Install 3rdparty headers for static buildsMichal Klocek2022-02-224-1/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | For static builds we need 3rdparty headers to be installed. Leaf modules like qtwebengine needs 3rdparty libs and header for zlib, freetype, harfbuzz, png, jpeg. Without those the Chromium bundled versions are used, however it might end up badly if qt has already bundled one. Introduce new header only modules with additional arguments for qt_internal_add_module: * EXTERNAL_HEADERS to pick exactly which headers are public * EXTERNAL_HEADERS_DIR to include whole directory preserving the files directory structure Fix qtsync so it keep directory structure for all non-qt modules when syncing headers and do not generate warnings for headers files. Task-number: QTBUG-87154 Task-number: QTBUG-88614 Change-Id: If1c27bf8608791cd4e0a21839d6316a445a96e9f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit be2745e4788cecb0d3122081e3328e4b66923609)
* cmake: avoid unused parameters in cmake testsTim Blechmann2022-02-223-3/+3
| | | | | | | | | | | unused parameters in cmake tests cause the tests to fail when the project is configured with `-Werror,-Wunused-parameter` Change-Id: If3065d008753a7718282dfc6ba0d79d46576cb34 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit d2ceb2e353304aeb91db4982afd8adeefdae3c3b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix cross-build without qt.toolchain.cmakeJoerg Bornemann2022-02-181-3/+4
| | | | | | | | | | | | | If there's no qt.toolchain.cmake used, QT_HOST_PATH_CMAKE_DIR is not set. Use the location calculated from the Qt6HostInfo package in that case. This amends commit e044c94a61f0cd2bdea1e89be4ec3c68007f7a5c. Change-Id: I99aed8e920b8c1aa6efd8f18301cc34aca5559ca Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 006224eb17d97cf5fca641d0de9900c1c60829d4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Add default launch screen storyboard for iOS appsAlexandru Croitor2022-02-164-3/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bundle a default LaunchScreen.storyboard file for an iOS app and make sure it's referenced in the generated Info.plist file. When launching Qt examples, it ensures the app uses the whole screen space on the device rather than just a square-ish part of it. The storyboard file is a copy of the qmake one, which qmake adds to the Xcode projects it generates. A custom launch screen can be provided either by setting the QT_IOS_LAUNCH_SCREEN variable or by setting the QT_IOS_LAUNCH_SCREEN target property. The value must be an absolute path to the launch screen file. The automatic addition of the launch screen entry in the Info.plist file can be prevented by setting the QT_NO_SET_IOS_LAUNCH_SCREEN variable to TRUE. The automatic bundling of the launch screen file in the application bundle can be prevented by setting the QT_NO_ADD_IOS_LAUNCH_SCREEN_TO_BUNDLE variable to TRUE. The current implementation has a limitation that only one launch screen storyboard and one iOS executable can exist within a project. If there are multiple executables in the project, all of them will use the launch screen that is specified last (the last qt_add_executable call). Because of this limitation, the API is marked as Technical Preview, to be improved upon in the future. For now it simply serves as an improvement to the out-of-the-box experience of iOS apps built with CMake. Amends 4d838dae5a821e9e5f013ba1d5a494ece1b5180e Fixes: QTBUG-95837 Change-Id: I6b067d703d635122959a1ef17fcca713da694a86 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit e5b3436255ce095af58608b03b913fc9bcb8e61f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Introduce QT_ADDITIONAL_HOST_PACKAGES_PREFIX_PATHJoerg Bornemann2022-02-154-24/+77
| | | | | | | | | | | | | When installing conan packages we have one installation prefix per package. When cross-building a conan package, we need to make known those multiple host prefixes to Qt, analogous to QT_ADDITIONAL_PACKAGES_PREFIX_PATH. Fixes: QTBUG-94524 Change-Id: I68cbede350f95266a5fd3559e9b9c214c5858eed Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit e044c94a61f0cd2bdea1e89be4ec3c68007f7a5c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add missing include of QtPublicCMakeHelpersAlexey Edelev2022-02-101-0/+1
| | | | | | | | | | | Amends 2201934efa1b9889d474347e705784bf6925e120 Task-number: QTBUG-99491 Change-Id: I449f0705f1e41fd4609008ae6a7f4107cd0a4ca6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> (cherry picked from commit 723a4e2b89f623323b74757c5041f020dcabe891) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use 'copy' but not 'copy_if_different' on Windows platformsAlexey Edelev2022-02-104-0/+38
| | | | | | | | | | | | | | Use custom script to copy big Android artifacts on Windows platforms. The script uses 'copy' but not 'copy_if_different' when source file size is bigger than 2GB. 'cmake -E copy_if_different' only compares first 2GB of files because of cmake issue, so this step only workaround the problem. Task-number: QTBUG-99491 Change-Id: Id076734700e334dfc3330da412462c2b53829b33 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 2201934efa1b9889d474347e705784bf6925e120)
* CMake: Handle slashes in qt_internal_add_exampleAlexandru Croitor2022-02-091-0/+13
| | | | | | | | | | | | | | | qtdeclarative has a call like qt_internal_add_example(imagine/automotive) This causes issues when trying to pass that as the name of the external project. Use the last part after the last slash as the name of the project. Change-Id: Ifc074e50e537f07f3636699ed255d2561930d873 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 92dff7c5f80fbc1e628a278ec4c2b216d24e04bb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Assign proper postfixes in multi-config buildsAlexandru Croitor2022-02-091-2/+29
| | | | | | | | | | | | | | | | | | | | | | | In a single-config build on Linux, we usually don't want a debug postfix in library names (as opposed to Windows/macOS). But when doing a multi-config build on Linux, assigning no postfixes causes CMake to generate rules for a single config only, the first one specified in CMAKE_CONFIGURATION_TYPES. This leads to being unable to build all configurations from the same build.ninja file as well as other obscure issues like race-conditions when generating prl files. To address this, when doing a multi-config build, always assign a postfix for each config except the first release-like one, while preserving the existing rules we had for debug postfix names. Fixes: QTBUG-100493 Change-Id: Ie9c88e074abdcf2961d7b3dee19a5694292717b8 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 90b07054f6de3ad101416b1ab5a10d7fee801a1c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* configure: Switch error to warning when -skip used in per-repo buildAlexandru Croitor2022-02-091-6/+4
| | | | | | | | | | | | | | Yield a warning instead of an error that -skip and -submodules have no effect in a per-repo build. Amends acaba632605ac22aa3da4c3cf8e5891cb9cde657 Adjusts to 11ae0e772cccd3028771c1380f077c605224cc19 Change-Id: Ic26b0ba29e48be5162f13ad75308f8358d8878e3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 94b158134c8819c74ccddd2c8877a44c12f1c4c9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix the run of _check targets in multi-config buildsAlexey Edelev2022-02-091-2/+8
| | | | | | | | | | | | With Ninja Multi-Config generator it's necessary to provide the '-C' option matching the build configuration when running ctest. This patchset adds the missing option to the command line of the '_check' targets. Change-Id: I42acfba26a09877a6d3a5be9230860f15f95a0cd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 3bee7db4198712c763dbd754bad7b2c851147038) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use builtin test data on IntegrityAlexey Edelev2022-02-091-1/+1
| | | | | | | | | | Looks like Integrity doesn't deal well with external test data either. Change-Id: I8beb5ac4d2440d40a7efdceae973e430a2354e9d Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit e2b98627a82e4cc9e8e47dd8bc71ef850becae7f) Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Temporarily disable building external examples in prefix buildsAlexandru Croitor2022-02-091-1/+9
| | | | | | | | | | | | | | | | | | | There are issues when building examples as external projects in the CI in child repos like qtsvg. QEMU configurations fail to find some CMake Config files, Windows configs fail to find libraries. Until these issues are fixed, build examples in-tree (without using external projects) like we did before. Temporarily disables 98c89c8cc1c5ceb4bfbb5f5ed6c96ecdbab99afa Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: Ia4b39812b27cfde5f5a103fd39cc1cb032842643 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit d1c825ae8cf5eca58f99b49913ac106ee9104f9c)
* CMake: Allow installing examples outside of the Qt prefixAlexandru Croitor2022-02-092-1/+14
| | | | | | | | | | | | | | | | | | | | Introduce a new QT_INTERNAL_CUSTOM_INSTALL_DIR variable to allow specifying an 'examples install dir' outside of the Qt prefix. It will be used in a follow-up change to ensure we don't package the example binaries in our CI artifacts (thus saving space). This will be even more important when the examples will contain code to deploy Qt libraries alongside each deployed example (which would significantly increase the package size). Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: I06b4a8f9e8c57a712a356bca0f5c351a9362bc30 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 1031fa15472bba3f20691cda2305e0821391c5db) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Build examples as ExternalProjects in prefix buildsAlexandru Croitor2022-02-092-27/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change prefix builds to use ExternalProjects to build examples by default. This will affect our CI which only does prefix builds. To make it work, we have to do a few adjustments: - look for Config files in the build-tree (before Qt is installed) - build only one examples with only a single config, even if Qt is a multi-config build - install examples as part of main make install step, rather than as part of the make step (which is the default for EPs) - adjust CXX flags when building with MSVC to ensure we can still use sccache and separate debug info - derive the correct install prefix for each example and pass it to the ExternalProject As a drive-by, add TODOs to address tidiness of the code and corner cases that likely don't work (Conan). Amends d97fd7af2bc5c89a0ad9e5fac080041b78d01179 Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: I3060da5dc64e7b06052f9dcb720d4d250f876450 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 98c89c8cc1c5ceb4bfbb5f5ed6c96ecdbab99afa) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Copy FindFoo.cmake scripts to build dir in prefix buildsAlexandru Croitor2022-02-091-0/+11
| | | | | | | | | | | | | | | They are used by build dir Qt6FooConfig.cmake files in conjunction with export(EXPORT)'ed target files when building ExternalProjects against a non-installed Qt (or in a top-level build). Change-Id: I688caf1bd1b8a8fe7e549cebade2aef6f928bd6c Task-number: QTBUG-90820 Task-number: QTBUG-96232 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 1273ffb0002b14d952807c250dbcc6228f60ff26) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Deduce install prefix of example in qt_internal_add_exampleAlexandru Croitor2022-02-091-2/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to get rid of the INSTALL_EXAMPLEDIR and INSTALL_EXAMPLESDIR code in each example project. This was an internal workaround to ensure examples are installed into a relative path somewhere under $qt_prefix/examples and not in $qt_prefix/bin or similar. To achieve that we do two things. First, deduce the install prefix for each example in the implementation of qt_internal_add_example (our add_subdirectory wrapper) and assign it to CMAKE_INSTALL_PREFIX before calling add_subdirectory. We need to make sure to remove the default value of CMAKE_INSTALL_PREFIX in the generated cmake_install.cmake file. Second, we set an internal variable called QT_INTERNAL_SET_EXAMPLE_INSTALL_DIR_TO_DOT before the add_subdirectory call, which will be checked whenever find_package(Qt6Core) is called in an example project. If the variable is set, the INSTALL_EXAMPLEDIR var is set to "." in the scope of where Qt6Core is found. This ensures that the hardcoded INSTALL_EXAMPLEDIR values in our example projects are changed to ".". With both changes, our example project install(TARGET DESTINATION) calls will now install to "${CMAKE_INSTALL_PREFIX}/examples/${example_relative_dir}/." Once all repositories are updated to use qt_internal_add_example instead of add_subdirectory, we can get rid of the QT_INTERNAL_SET_EXAMPLE_INSTALL_DIR_TO_DOT workaround. For repositories that still don't use qt_internal_add_example, the install prefix rewriting will not happen, but the examples will still be installed to the proper place because they use their own hardcoded INSTALL_EXAMPLEDIR value. Amends d97fd7af2bc5c89a0ad9e5fac080041b78d01179 Task-number: QTBUG-96232 Task-number: QTBUG-98545 Change-Id: I78c118e10c41b519c570c7d87529afd15aeed900 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit ac4a913f333561803003650817de453f43be924d) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Shorten ExternalProject example project pathsAlexandru Croitor2022-02-091-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | Instead of nesting the external project build dir under the current binary dir, place the EP build dir where it would usually be when we use add_subdirectory. Shorten the name of the external project to just ${subdir} instead of using the relative current binary dir path. Place the EP prefix and stamp dirs under a new ${subdir}-ep folder next to the example build dir. Overall this places example executables where you'd usually expect them to be, as well as shortens a bunch of build paths to circumvent path limit issues when building on Windows. Fixes: QTBUG-94608 Task-number: QTBUG-96232 Change-Id: Ifb921c5a6397385e8a914111bf56ee59cda003fd Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 1a103beff61542c5149c3876a7bb0885ec989c0a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Split qt_internal_add_example into two functionsAlexandru Croitor2022-02-091-5/+12
| | | | | | | | | | | | One for building using ExternalProject_Add and one when examples are built in-tree by calling add_subdirectory directly. Change-Id: If4c5301163aefed9f15148a70a8f7014bc817ac0 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 209438c16ab6904efeda936ceefcc0ae7d14d85f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Run export(EXPORT) for prefixed and top-level buildsAllan Sandfeld Jensen2022-02-091-7/+11
| | | | | | | | | | | | | | | | This is necessary to be able to find Qt6 modules in CMake ExternalProjects before Qt is installed, regardless of top-level or per-repo builds. One use case is examples that are built as ExternalProjects. Task-number: QTBUG-90820 Task-number: QTBUG-96232 Change-Id: Ic6a9bfd1c52a04e34b221deab40f419a6fee9463 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit b954a79e25f15bbce499afaa4304e7ab71648cd5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix rpath set for Qml plugins to not contain lib64Alexandru Croitor2022-02-041-0/+5
| | | | | | | | | | | | | | | | | | | | | | Qt6QmlMacros uses the value of GNUInstallDirs's CMAKE_INSTALL_LIBDIR to calculate the rpath from a Qml plugin's location to the Qt libraries. By default CMake detects the value of CMAKE_INSTALL_LIBDIR, and on an RHEL system it is set to 'lib64', whereas we usually configure Qt with the lib dir set to just 'lib'. This might cause issues with Qml plugins not locating the Qt libs due to an incorrect rpath. Ensure that when building Qt libraries and plugins, CMAKE_INSTALL_LIBDIR is set to the same lib dir value that Qt was configured with. Fixes: QTBUG-99707 Task-number: QTBUG-100432 Change-Id: I17b2a22d46ef3b40084a2f6a4992f0e23b35d4d3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit bb9be221339b67b7580e92efc673f8919f4b1db8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* configure: Raise error if -skip/-submodules is used in per-repo buildAlexandru Croitor2022-02-041-0/+10
| | | | | | | | | | Specifying the options would do nothing, so it's better to error out early in case the developer accidentally added them. Change-Id: Ia516468a22c3c48e9e84dc78e522e8870186d96b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit acaba632605ac22aa3da4c3cf8e5891cb9cde657) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* configure: Introduce -submodules optionAlexandru Croitor2022-02-042-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The option is used to specify a list of Qt repos (git submodules) that should be included in the configuration of a top-level Qt build. The option takes a comma-separated list of qt submodule names e.g. 'qtbase,qtsvg,qtdeclarative' It can also take a single value like 'qtbase' or 'qtquick3d'. Each specified submodule and all of its transitive dependencies will be included when configuring the top-level Qt build (assuming that the submodules have previously been already checked out). Any missing submodules or dependencies will not be automatically checked out, but rather skipped. This can result in a failed configuration if a required submodule is missing. If some optional transitive submodule dependency is not desired in the build, you can combine the -submodules option together with -skip options. E.g. configuring with -submodules qtdoc,qtnetworkauth -skip qtmultimedia,qtimageformats will result in a top-level build with the following submodules: - qtbase (common dependency) - qttools (dependency of qtdoc) - qtactiveqt dependency of qttools) - qshadertools (dependency of qtdeclarative) - qtdeclarative (explicit) - qtnetworkauth (explicit) - qtdoc (explicit) Fixes: QTBUG-100388 Change-Id: Ie8c47cfd1d1e0e44a27260bf9ddf968531cc1cc0 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 7cb2bbd9e765bd90a2df06c7256d0306d669fbe6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* configure: Allow specifying a comma separated list to -skip optionAlexandru Croitor2022-02-042-3/+16
| | | | | | | | | | | | | | | | | This makes skipping a list of submodules more concise. e.g. instead of passing -skip qtsvg -skip qtimageformats -skip qtmultimedia pass -skip qtsvg,qtimageformats,qtmultimedia Change-Id: I6a48828b2fd7cec9f6e19988f7b4033333768abb Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 40155ddd0ebec827b315549c5d528d8d3070f5fb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make one QT_REMOVED_SINCE/QT_BUILD_REMOVED_API per moduleMarc Mutz2022-02-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A single global QT_REMOVED_SINCE will start hurting us once more modules downstream of QtCore start using the mechanism. With every use of feature, the set of code that needs to compile under QT_BUILD_REMOVED_API increases. Since we use QT_REMOVED_SINCE in situations where overloading the new and the old function don't work in general, this means all code included by any removed_api.cpp needs to be very carefully written to ensure that any calls to the overload set formed by the combination of old and new function(s) don't create ambiguities. Likewise, the set of APIs that change semantics under QT_BUILD_REMOVED_API also increases. At some point, the combination of removed_api.cpp including almost every module header and almost every header exposing source-incompatibilities when included in removed_api.cpp will make maintenance a headache. By making QT_REMOVED_SINCE and QT_BUILD_REMOVED_API per-module (QT_CORE_REMOVED_SINCE, ...), easy now that we generate the export macros using CMake, we limit the scope of this problem to the module using the feature. Downstream modules (say, QtWidgets) will now see the QtCore API like every other user, even in the widgets/compat/removed_api.cpp TU. Change-Id: I177bc7bd5aa8791639f97946c98e4592d2c7f9d9 Reviewed-by: Edward Welbourne <edward.welbourne@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 0d9f4e7526fbf1e072aa3518e4e5313332ee4f18)
* Handle glib optional components properlyIlya Fedin2022-02-031-19/+31
| | | | | | | | | Fixes: QTBUG-97929 Change-Id: Ic73548cb10680a2ccd60faed2b0548c82892eaa1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 5a0849ed6b44657f3b680ab552d5f0ca4a9261d3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add qt_internal_undefine_global_definition functionAlexey Edelev2022-02-023-17/+23
| | | | | | | | | | | | | | | | | qt_internal_undefine_global_definition disables an internal global definition that is defined by the qt_internal_add_global_definition function for a specific target. Remove the ability to set the custom "undefine" flag for the definitions since it's hard to control it using the introduced function. Task-number: QTBUG-100334 Change-Id: Ic1637d97aa51bbdd06c5b191c57a941aa208d4dc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit fd3341a74ecbe93c5fb931f625075b93be69b9de) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Restore missing Qt definitionsAlexey Edelev2022-02-012-0/+76
| | | | | | | | | | | | | | | | | | Restore the 'QT_NO_JAVA_STYLE_ITERATORS' and 'QT_NO_NARROWING_CONVERSIONS_IN_CONNECT' definitions for Qt targets. Add the function that adds global definitions for Qt targets according to the provided scope and the target property-based switch to disable the definition for a specific target. Task-number: QTBUG-100295 Change-Id: I28697e81f9aabc45c48d79aae1e5caea141e04e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 1d28fd7a9c4720289f3d41db2ed8e6fcb07d5a30) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: fix running of headersclean targets when CMAKE_CXX_FLAGS is setThiago Macieira2022-02-011-1/+1
| | | | | | | | | | | | | | | We were passing the full option from the user as a single string in the command-line to the compiler. clang++ -c "-O3 -g1 -march=tigerlake -mprefer-vector-width=256 -maes" [...] error: invalid integral value '3 -g1 -march=tigerlake -mprefer-vector-width=256 -maes' in '-O3 -g1 -march=tigerlake -mprefer-vector-width=256 -maes' Fixes: QTBUG-100315 Change-Id: I6fcda969a9e9427198bffffd16ce83150d4e4263 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 05e029619f18e66d587075e929bc2d8c384f367a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix finding GSSAPIAllan Sandfeld Jensen2022-01-301-2/+5
| | | | | | | | | | The package is called mit-krb5-gssapi on Ubuntu, and the LIBDIR variable was missing an underscore. Change-Id: I85b5603c1161f33462aa71bbd522d40dd7489405 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 7e591453be37caf4d8e2bcb7ebc6b706b84f50be) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix host UiTools being picked up instead of target oneAlexandru Croitor2022-01-271-0/+1
| | | | | | | | Fixes: QTBUG-100233 Change-Id: Id4b30841ba9e499f462325f882218edf407e0a00 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit c8621da85265ecec8968eb54bfaa1558474f241b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Display CMAKE_BUILD_TYPE when including QtSetupAlexandru Croitor2022-01-261-0/+2
| | | | | | | | | | | This will show the CMAKE_BUILD_TYPE that was computed for a configured repo or standalone tests, after the logic in QtBuildInternalsExtra.cmake is executed. Change-Id: Ib8ffa2c7806a4c16385a2fcd4500f8a0f6a9aa88 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 0d5dc56554988edb87cb1575220a107c8a1f9cc4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix build with clang-clYuhang Zhao2022-01-261-1/+1
| | | | | | | | | | | | | | 1. Clang-CL can't recognize "/d2FH4" and it's causing lots of warnings when compiling. So don't apply it when building with clang-cl. 2. The definition of "FS_INFORMATION_CLASS" need to be visible to clang as well. Don't know why it was excluded originally. Change-Id: I7b6e14999eea0ba1f0d73962ff03a35548f88a5a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit c532a576708254e725bf87e3b4f74d29749e709a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Support overriding CMAKE_BUILD_TYPE per-repo or testJoerg Bornemann2022-01-243-7/+53
| | | | | | | | | | | | | | | | | | | | | | One might want to build qtbase in Release, but qtsvg or some test in Debug mode. Before if qtbase was configured as Release, there was no way to override that. Now we try to detect whether a custom build type was specified to qt-cmake / qt-configure-module / qt-cmake-standalone-test / qt-internal-configure-tests Note mixing won't work on Windows due to different C/C++ runtimes. Also, now we don't force set a single build type when a multi config generator is used as well as one opts out via the QT_NO_FORCE_SET_CMAKE_BUILD_TYPE variable. Change-Id: I6dc4325087ff7f905ad677d87b0267e2f3e4693f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 33af62db3747bb6fcb7490ef2d2abc5bb53925b6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Add OUTPUT_TARGETS option to qt_internal_add_resourceUlf Hermann2022-01-211-1/+5
| | | | | | | | | We need it for shadertools. Change-Id: I9e9c76e535e5cd698564b48beedb7380b08173e2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Simeon Kuran <simeon.kuran@gmx.at> (cherry picked from commit 6442fbafcd498d1c9946b612e1e35f4679d1b3c8)
* CMake: Add support building Qt with the 'mold' linkerAlexandru Croitor2022-01-211-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | The mold linker is a new linker for Linux that provides faster link times compared to BFD ld, ld.gold and lld. It can be found at https://github.com/rui314/mold To build Qt with mold, ensure that the binary in your PATH and then configure Qt with with either cmake /path/to/qtbase -DINPUT_linker=mold or /path/to/qtbase/configure --linker mold The change was tested with gcc 9, clang 10, clang 12, mold 1.0.0. Only qtbase and qtdeclarative (and dependencies) were tested. Task-number: QTBUG-99270 Change-Id: I2e64a1f4257c37ff5b64a9326e548b9b46e07c80 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 158287c726b9ee7031c6e832dc159d02473e34d7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix qt_run_linker_version_script_support to use active linkerAlexandru Croitor2022-01-202-1/+12
| | | | | | | | | | | | | | | | The version script compile test did not use the linker that the build system determined to use to link Qt, but rather the system linker. Run qt_run_linker_version_script_support only after the global qtbase features have been evaluated and make sure to include the active linker flags. Change-Id: I0ff82406828daaf0dc5ec25a55f53ac7d98e3347 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 9198a9b8cc8df04ad130410a9c9f32de2b7b2335) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix detection of linker availabilityAlexandru Croitor2022-01-203-16/+36
| | | | | | | | | | | | | | | | | | | | | Previously we passed flags like -ld-fuse=lld only to compile calls, but not to the link call of a compile test project. Make sure to pass it to the link call instead by using check_cxx_source_compiles + CMAKE_REQUIRED_LINK_OPTIONS instead of check_cxx_compiler_flag. Note the flag that is passed is still via passed via the compiler launcher and not directly to the linker. Remove duplicate flag handling code. Change-Id: I1bf90573904a9df83240b6debfee3cc9e425c6bb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit d6066d53fa70e1736ca64d468605a4a430644400) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix dbus headers not being added in qt_internal_extend_targetAlexandru Croitor2022-01-181-2/+2
| | | | | | | | | | | The generated dbus headers would not appear in IDE source lists because of incorrectly named variables. Change-Id: I276d4284eb94b98cc75f791de62ca332ad947004 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 461f68c5c9a4feadc9805fa0c1efc79010364770) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Clang: don't error out on -Wdeprecated-enum-enum-conversionMarc Mutz2022-01-181-0/+6
| | | | | | | | | Same treatment as is given to GCC further below. Change-Id: I3762c39a0b5d9add365ecf828b80d3ba432578c2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 208cfad9adbea950c6bf9dc2fbc190cfb7e07e20) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>