summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* Fix plugin SKIP_INSTALL optionAlexey Edelev2021-04-271-5/+14
| | | | | | | | | | | If SKIP_INSTALL option is specified for the qt_internal_add_plugin function the install_directory variable become empty and finalizer unable to call qt_finalize_plugin, because of lack of the second argument. It makes sense to use the INSTALL_PATH single argument instead. Change-Id: I2d4b40c8cf812a834c0e045569b45a649d339508 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 361daa2990ddb70805d356ce5df7d8cfae8e1954)
* CMake: Install prl files from all repo build dirs in a top-level buildAlexandru Croitor2021-04-261-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, in a top-level build we always generated the final prl file somewhere under QT_BUILD_DIR (which is qtbase_build_dir). After each repo was processed by QtPostProcess.cmake, we installed the prl files found in PROJECT_BINARY_DIR. For qtquickcontrols2 this meant that qml plugin prl files were placed under qtbase/qml, but we tried installing the prl files from qtquickcontrols2/qml, which didn't have any prl files. In a static Qt build, qmake's qt.prf calls qmlimportscanner to identify which plugins should be linked to the executable. This worked fine because the plugin .pri files were installed correctly. None of the qml plugin library dependencies were linked in though. This is supposed to happen in qmake's C++ code where it tries to find the associated prl file of a linked library in order to extract all its dependencies. Because no prl file was found, linking failed with multiple undefined symbols. Fix this by installing the prl files from QT_BUILD_DIR rather than PROJECT_BINARY_DIR. Note that this will create multiple install rules for certain files, but it's harmless. An example is imageformats. We process qtbase plugins, see qjpeg, issue an install rule from under the qtbase/plugins/imageformats folder. We then process qtimageformats plugins, see webp, issue another install rule from under qtbase/plugins/imageformats. The first install rule will install both qjpeg and qwebp, the second install rule will merely say all plugins are up-to-date. Change-Id: I8a4bb67bfafc1d016eab62f4fe66b6ba378ceeb2 Fixes: QTBUG-93021 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 31ee3c84a78afa67eeb4e4b6da5a8181ea62c387) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Skip adding externally added plugins to the plugin meta-setsAlexey Edelev2021-04-261-3/+7
| | | | | | | | | Plugin meta-sets are not visible outside of the module build tree, so there is no point in adding dependencies for externally added plugins. Change-Id: Ica5b29b57c032f4fc9b128172aaa806392e9e581 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit bbe26a766748c00da5e2241a9c7ec5e714dd76ad)
* Fix top-level build repository targetsJoerg Bornemann2021-04-191-9/+10
| | | | | | | | | | | | | The directory-level targets missed the first level of sub-targets. E.g. `qtbase_qmake` did not have a dependency to `qmake`. Fix qt_build_internals_get_repo_targets to first grab all targets of the subdirectory and then recurse. Change-Id: I3604000caec22fac9a4cc5f5aaf651d550d16793 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 82f8519b827ba7fd89f8168632461f47b09605a7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Warn when using CMake 3.20.1 due to crashes in AUTOMOCAlexandru Croitor2021-04-171-0/+6
| | | | | | | | | | | | | With CMake 3.20.1 AUTOMOC can crash or hang on Windows when used with a Qt installation that supports moc depfiles due to missing multi-threaded locking. Warn and advise to use a different CMake version instead. Change-Id: I78d2269c48dfc2541bebcd6ab23aaa5595012149 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit aab8a0ac6e5365d97d3c7571b26430776b7b5f49) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Warn if using CMake 3.20.0 due to potential cyclic dependenciesCraig Scott2021-04-121-0/+5
| | | | | | | | | | | CMake 3.20.0 can create autogen-related cyclic dependencies that are only detected at build time by Ninja, which then fails with a build error. Warn and advise to use a different CMake version instead. Change-Id: I9bef973ad2efdb69f28d6a9e0584b543be59f17f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 6442116078500b0e7c401430b74bd40f32cfafb4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove unnecessary $<BOOL:...> generator expressionCraig Scott2021-03-221-4/+1
| | | | | | | | | | The $<NOT:...> genex already guarantees to return a value of 0 or 1, so there's no need to wrap it with $<BOOL:...>. Change-Id: Iff4ad64ed8deaa846e1b5bc22d2e5d9dbcd77cc7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit df121fd7f74ecfb3de20867edea1c1f3ebf035c2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: make sure to collect Android dependencies for pluginsAssam Boudjelthia2021-03-183-42/+67
| | | | | | | | | | | | | androiddeployqt relies on *-android-dependencies.xml files to know what dependencies like jar files and permissions a Qt module requires. CMake create those files under Qt prefix's lib dir but CMake was not accounting for module plugins. Fixes: QTBUG-90812 Change-Id: Ib3b2e2bb237159b4851ac0f23dc75f8e56af3f7a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit d6367aca869ee30e15a3861b2990baafb9972aa1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Prevent static plugin triggering autogen dependency on reconfigureCraig Scott2021-03-181-7/+15
| | | | | | | | | | | | | | | | | | | | | A call to file(WRITE) will unconditionally update the file's timestamp even if the file's contents don't change. The *Plugin.cpp file was being written using configure_file() which avoids that, but the .cpp.in file it was configuring from was being written out using file(WRITE) every time CMake ran. Autogen saw that file as a dependency and then regenerated the mocs_compilation.cpp file, which in turn results in unnecessary rebuilds and relinking when nothing is actually changing. The file(WRITE) - configure_file() dance is no longer needed anyway, since the generated *Plugin.cpp file is very simple with no substitutions required. Therefore, we can simplify that file's generation with a single file(WRITE) that only executes if the file contents will change or the file is missing. Change-Id: I2b7d1ff678b85ea7811969d656555592c9b6865f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 63a0d263cf233ddf85a60678829298b50e8d1f26) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Don't attempt to add to a target that doesn't existMårten Nordheim2021-03-171-2/+4
| | | | | | | | | | | When configuring a benchmark using the standalone-test script the 'benchmark' target is not available, causing a configure error. Change-Id: I8e480c9e72b47783c0910428187f0092049e89db Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 1d6a35c5363944ce59eba114f827b1992f31bde3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Bump Apple platform minimum versionsAlexandru Croitor2021-03-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | Includes both minimum deployment targets and minimum sdk versions. As per supported Apple platforms versions which was done in qt/qtdoc at 8807fdedce29cbbd7662fcd745234da30eace3fb For Qt for iOS 6.0.x we only bump the minimum deloyment target because applications seem to crash with iOS 12.4+, and it's better to have a build error than a runtime error. The minimum required sdk will not be bumped for 6.0.x, so we don't accidentally break someone's existing build, given that 6.0 is already released. Task-number: QTCREATORBUG-23574 Change-Id: I3046384164f2d7fdbd0cfd16dcb85e0d60bc56ce Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 4b2035cd0f9a7c289c7a9e470fde83dae9351092)
* Fix FindWrapOpenSSL.cmake if OpenSSL::Crypto is UNKNOWN_LIBRARYJoerg Bornemann2021-02-231-1/+1
| | | | | | | | | | | | The attempt to call target_link_libraries on OpenSSL::Crypto failed when this target was added as UNKNOWN library by FindOpenSSL.cmake. Instead, set the INTERFACE_LINK_LIBRARIES property directly. Fixes: QTBUG-90925 Change-Id: Idbc1379c89480225fc7a8d417416ed20404a1122 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit b6b9e54f167aab104600f4d4a2db71ae70561c3b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Coin: remove workarounds to allow running Android testsAssam Boudjelthia2021-02-181-2/+0
| | | | | | | | | | | | | | We had two workarounds: * script that adds Gui to tests * create a symbolic link for the qt install dir to fake_prefix which androiddelployqt was expecting them to be under Both issues are fixed, thus removing the workarounds. Change-Id: Ic022bece15afe92c693d573893d260b13b4227ed Reviewed-by: Heikki Halmet <heikki.halmet@qt.io> (cherry picked from commit bcbdbd50fefd90cc8cfe2c01d8f681dfe690971a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: handle Android features dependencies for modulesAssam Boudjelthia2021-02-181-0/+19
| | | | | | | | | | | | QMake used to allow retrieving the Android features list for a modules. The dependencies are written to *-android-dependencies.xml files and are read by androiddeployqt. This option was missed at some point along the way of writing CMake port for Qt 6. Change-Id: Ic0b82f024567e640968f97aeff2db1888f2b53a5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 09fc4f9525740b8c671c036413153d3419750b99) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Do not rewrite boolean INPUTs if they have a corresponding featureAlexey Edelev2021-02-181-12/+0
| | | | | | | | | | | | | | | | | | | Initial replacement of boolean INPUT_ variables to the FEATURE_ variables was wrongly changed to updating of the INPUT_ variable value to ON/OFF value. This causes potential issues when INPUT_ variable has explicit check for 'yes' or 'no'. The feature evaluation step enables FEATURE_ variables in case if the corresponding INPUT_ variable contains a positive CMake value. So there is no need to process boolean INPUTs at the argument processing step. Also no need to keep the special opengl case, since it will be processed correctly. Fixes: QTBUG-91158 Change-Id: I96bb7903a904ae3cf788d7ef7d4e0c019046eb95 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 530b62934923070b5b8b5c5b3c764a2b7d4db039) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: set minimum recommended android SDK to 29Assam Boudjelthia2021-02-131-1/+1
| | | | | | | | | | | | comply with the api version used by default with androiddeployqt and in docs. Google play also requires api 29 as minimum. Task-number: QTBUG-90943 Change-Id: I05e2a90b4d7f2120b0198e3fb7b8b1b2398eba93 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: BogDan Vatra <bogdan@kdab.com> (cherry picked from commit e711eb35f54cabf8b0beff49e5b748731d042c63) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: add Qt::Gui dependency by default for Android testsAssam Boudjelthia2021-02-111-1/+5
| | | | | | | | | | | | | | | | | | Normal Android apps require Qt::Gui dependency and since tests don't need to handle any special cases for an app without Qt::Gui, let's add it by default. This also will allow us to remove some workarounds done on CI side to run tests for Android. Fixes: QTBUG-90870 Change-Id: I845650c17a1b73e4c4977043f863ec44e50f06c3 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: BogDan Vatra <bogdan@kdab.com> (cherry picked from commit 85c7a9d3a6710f8487ce4aa1e4e2d7d1d46b6cde) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix completely wrong init_class and jar_bundle_native valuesAlex Blasche2021-02-101-2/+2
| | | | | | | | | | | This prevented androiddeployqt from properly deploying libraries which specify init class via the ":" delimiter. Change-Id: Ib9cfa7edc864d7d540577df22284ceb9714a2511 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> (cherry picked from commit 8cceb04232001e51276f1588d9e67f2c696fbe91) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* configure: Fix handling of -translationdir argumentJoerg Bornemann2021-02-081-1/+2
| | | | | | | | | | | This is supposed to be mapped to INSTALL_TRANSLATIONSDIR, not INSTALL_TRANSLATIONDIR (without the s). Fixes: QTBUG-90946 Change-Id: Icec93ffc0dc80d9ac7cf6cf1b13824bc2a1e795f Reviewed-by: Kai Koehne <kai.koehne@qt.io> (cherry picked from commit b9d1dc43f2764d765caf9fa8102aafea268ed3bb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake/QtAutoDetect: fix failure with multiline toolchain filePeter Seiderer2021-02-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The unquoted 'string(FIND ${toolchain_file_content} ...)' call fails for multiline content of the variable toolchain_file_content, so add quotes around, fixes: [...] CMake Error at cmake/QtAutoDetect.cmake:42 (string): string sub-command FIND requires 3 or 4 parameters. Call Stack (most recent call first): cmake/QtAutoDetect.cmake:311 (qt_auto_detect_android) CMakeLists.txt:19 (include) [...] -- Configuring incomplete, errors occurred! in case the given toolchain file starts with multiple lines in the first 80 characters, e.g. in the case of buildroot: # # Automatically generated file; DO NOT EDIT. # CMake toolchain file for Buildroot # [...] Task-number: QTBUG-90980 Change-Id: I8e038e08d83016e8253f2e83b2efb8f06034c6cd Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 8aff901f70def69c2ac56754ef4146150e43bf8a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add upstream version of FindPostgreSQL.cmakeAlexey Edelev2021-02-011-0/+317
| | | | | | | | | | | | | | Add CMake upstream(3.20.0) version of FindPostgreSQL.cmake, to avoid server-related headers lookup. Avoid using the Qt version of the PostgreSQL module, if it's older than the CMake's one. Fixes: QTBUG-89639 Change-Id: I71a0c3508000901969933aea8a08d1ad431db711 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit e3e1fc482053587811f39dcc9d1be231df00f660) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Fix HAVE_openssl config test when using static OpenSSLLi Xinwei2021-01-291-0/+12
| | | | | | | | | | | | | | | | | | When using static OpenSSL, HAVE_openssl test will fail, because of unresolved external symbols. These symbols are from Ws2_32.lib and Crypt32.lib, which CMake does not link by default. In qmake build system, we can use OPENSSL_LIBS variable to specify these system libraries. But there is no similar variable in CMake build system. Accordingly, we should let OpenSSL::Crypto target link these libraries. Upstream issue: https://gitlab.kitware.com/cmake/cmake/-/issues/19263 Change-Id: I5f27790b251d0a0f71aaf2aed2b933aeb3326f1f Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 29a58af4caea921e641c27477e6a255274de27ea) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix output files of the *_header_check targetsJoerg Bornemann2021-01-271-1/+3
| | | | | | | | | | | | | | | | Header files of a Qt module are usually found in subdirectories. Avoid creating object file paths like "header_foo/bar.h.o". When building with conan, the "header_foo" subdirectory was not created for whatever reason. Now, we make sure we have clean object file paths, e.g. "header_check/foo/bar.h.o", and we create the directory upfront before invoking the compiler. Pick-to: dev Fixes: QTBUG-90529 Change-Id: Ifa5d6b97e07fc4e249c58cda5128439d60b14f5f Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Update start of cmake/README.mdKai Köhne2021-01-251-18/+18
| | | | | | | | | | | | | | | Make the document reflect the current status of the port. Also link to https://doc.qt.io/qt-6/build-sources.html and https://wiki.qt.io/Building_Qt_6_from_Git as official sources on how to build Qt. This document should IMO rather concentrate on documenting the build system internals. Change-Id: If62cb966b41b7452edb5b63725756916b66affac Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit cf9683601857bb8ba0a5f24b13affa9de1e27ef8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QMAKE_PRL_LIBS entries on Windows for modules from other reposJoerg Bornemann2021-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | When building a repository != qtbase, like qtactiveqt, QMAKE_PRL_LIBS contained entries like Qt6Core and Qt6Widgets, meaning the linker line would contain exactly these arguments. When building an activeqt example with qmake, the link then failed with "LNK1181: cannot open input file 'Qt6Widgets.obj'". The correct entry would have been $$[QT_INSTALL_LIBS]/Qt6Widgets.obj. Fix this by determining the full path to the import library in the first step of the prl generation. This enables QtFinishPrlFile.cmake to recognize Qt6Widgets as Qt module and generate the right QMAKE_PRL_LIBS entry. Fixes: QTBUG-90520 Change-Id: Id0d9178da0e0dfc3ea4fadbbe8f5900d792ffc84 Reviewed-by: Kai Koehne <kai.koehne@qt.io> (cherry picked from commit 1ef5016bab3bce06ada14bc961a2a1db93d3060b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix framework path for *_header_check targetsJoerg Bornemann2021-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | When building a Qt module against an installer-provided Qt on macOS, the module pulls in the headersclean feature that creates the *_header_check targets. Those targets try to compile the public headers of the module, and the compilation command contains the -iframework argument. That -iframework argument is supposed to point to the directory where the Qt libs are installed. However, it pointed to the original CMAKE_INSTALL_PREFIX of the machine where Qt was packaged. Use the QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX variable instead that contains the real installation location, even for an installer-provided Qt. Fixes: QTBUG-90402 Change-Id: I27de8b3cc816488c2716042383b334d5c421452d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit bd8d74e0e265297d61fe3b42f71a282bf381c379) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QtEntryPoint: Fix linking Release against RelWithDebInfo with MSVCJoerg Bornemann2021-01-181-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | To be able to link a Release user project against a RelWithDebInfo Qt we set several IMPORTED_*_RELEASE properties in the *AdditionalTargetInfo.cmake file of each Qt module. The EntryPoint module however is a bit special as it is an INTERFACE_LIBRARY linking publicly against a static library (EntryPointimplementation). Its *AdditionalTargetInfo.cmake file was almost empty, because qt_internal_export_additional_targets_file was called before EntryPointImplementation was set up. Also, qt_internal_add_module, which calls qt_internal_export_additional_targets_file, does not know that we want to export the EntryPointImplementation target. We fix this by telling qt_internal_add_module(EntryPoint) to not generate the *AdditionalTargetInfo.cmake file and call qt_internal_export_additional_targets_file later to take the targets EntryPoint and EntryPointImplementation into consideration. qt_internal_add_module learned the option NO_ADDITIONAL_TARGET_INFO to turn off the generation of *AdditionalTargetInfo.cmake files. Fixes: QTBUG-90039 Change-Id: I68ec7125b538a57567035e7adb8dac3b213f95e6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit b0add5bf2f56c2afc8bdf27ccbb153414617250b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Lower the CMake minimum required version for single-config buildsJoerg Bornemann2021-01-141-0/+10
| | | | | | | | | | | | | | | | | | | | | Ubuntu 20.04 is a supported platform and comes with CMake 3.16. The current state of the Qt build works fine with this CMake version, mainly because the default build on Linux is single-config. For multi-config builds we have higher version requirements as documented in cmake/README.md. This lowers the barrier for users using single-config builds who don't want or cannot upgrade to CMake >= 3.18. For Ninja Multi-Config builds, which were introduced by CMake 3.17, we yield a warning that 3.18.3 is the lowest supported version. Change-Id: Ia918b9f2b494508e86301ffc0e138d3ad4dbaf86 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 20a17911576297f22b9da9849b677476c2d6e0ea) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix warning in generated test wrappersAlexey Edelev2021-01-131-1/+2
| | | | | | | | | | | | | | Since test command variable may contain quotes, there is a warning in generated test wrappers related to 'message(FATAL_ERROR', that should display full command in log in case of error. To avoid any complicated quoting of command to only display it, join command into single string in wrapper script and pass resulting variable to 'message(FATAL_ERROR'. Change-Id: Ie990fc0b0bf2c19b119c7c4e2aeec092e5200103 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 7582f7b03d52103c5299812aed8705d21d4f8b9b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Use -ffat-lto-objects for static libraries with ltcg and GCCChristophe Giboudeaux2021-01-131-0/+8
| | | | | | | | | | | | | | | CMake <= 3.19 adds the '-fno-fat-lto-objects' compiler flag unconditionally when CMAKE_INTERPROCEDURAL_OPTIMIZATION is enabled. This is fine for shared libraries but static ones need the opposite compiler flag. Task-number: QTBUG-89426 Change-Id: Ie5f48178803a270f6d94408f7a8e85d379eb123c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 9563be2870b85309e163db950fefcb9200cac6f4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove redundant .qch from installed docsAlexey Edelev2021-01-081-1/+3
| | | | | | | | | | | Use upper-level document build directory for generated .qch files. This avoids copying of .qch with html documents and duplicating them in the installation directory. Change-Id: I63b2de0047005419d352ea259dec6f17a826a477 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 4d34314679598078d11508f540fe75f51a879046) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: improve FindMySQL.cmakeLi Xinwei2021-01-081-10/+9
| | | | | | | | | | | | | | | | On Windows, Qt should libmysql.lib instead of mysqlclient.lib. Add support for mariadb. Re-indent FindMySQL.cmake. Fixes: QTBUG-88661 Fixes: QTBUG-89775 Change-Id: I6bdf195b8976c59230a12af335a838af55df0caf Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 0c7042defaf3a2a97aebc6f652b4d34229093a5a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add newline to the end of the config.summaryAlexey Edelev2021-01-081-0/+1
| | | | | | | | | Amends 94b6bec01f250065b28d5528ea9239bafd5253e5 Change-Id: I0d4be9c7f9aff071468a66d7940d6cd2488136ca Reviewed-by: Cristian Adam <cristian.adam@qt.io> (cherry picked from commit 7f5429f2f45bdfb20ea67ebc9a75891bc5ee6549) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix qch install pathAlexey Edelev2021-01-071-1/+1
| | | | | | | | | | Exclude qch_file_name from install DESTINATION Fixes: QTBUG-89769 Change-Id: I8dba13a0a2c2c92d6b2d6aa438c295b42a04156b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 0f38f69d4493d44ef65c4e1ab52f990241139c6a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Add proactive check of generator multi-config capabilitiesAlexey Edelev2021-01-051-0/+10
| | | | | | | | | | | Add explicit error, if multi-config build is requested, but selected generator doesn't support it. Fixes: QTBUG-88287 Change-Id: I6dba589bb59ad69fa07221c657df272ec75c359b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 52e1603e33db9ef29fe1eff8c689d38166d393f1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix missing report entriesAlexey Edelev2021-01-051-2/+2
| | | | | | | | | | | Increment command_count correct way. Fixes: QTBUG-88054 Change-Id: I0769814ed75ee12db1cab3b1f85635b4d7ee0605 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 01708a44de2c9fe83e554099528b9c2f0a30d731) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix glitch in module pri generation for Ninja Multi-ConfigJoerg Bornemann2021-01-041-0/+1
| | | | | | | | | | | | | | | With Ninja Multi-Config, QMAKE_LIBS_FOO_DEBUG and QMAKE_LIBS_FOO_RELEASE are generated, if their values differ. In that case we did not create an empty QMAKE_LIBS_FOO assignment. That, however, is needed to make the library 'foo' known to qmake_use.prf. This amends bd98ba0d17b7a7c14fefc1741e68e8ca945a6655. Fixes: QTBUG-89387 Change-Id: I80e23746e6ba6ff7f5f4186116232395814cee15 Reviewed-by: Cristian Adam <cristian.adam@qt.io> (cherry picked from commit e40b31fe6803dea39649c7c61eaca5b8d597dacf) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* CMake: Fix dirty summary file when reconfigure qtAlexey Edelev2020-12-301-1/+2
| | | | | | | | | | | | Overwrite summary file during each configuration cycle. Amends 6baf36d77432dc56a47e50f59ccde93b73cfe204 Fixes: QTBUG-87830 Change-Id: Ie77f9aded4a7395592ff3cefad02265d836bebcc Reviewed-by: Cristian Adam <cristian.adam@qt.io> (cherry picked from commit 94b6bec01f250065b28d5528ea9239bafd5253e5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "CMake: Fix missing report entries"Alexey Edelev2020-12-301-2/+1
| | | | | | | | | | | This reverts commit 642ee46f98c6b3cd98a323f7dc5cac3a738b066c. Reason for revert: Issue when command_count is actually 0 Change-Id: I1b2603f25b56e3bd50cfc22a08925930ad231498 Reviewed-by: Cristian Adam <cristian.adam@qt.io> (cherry picked from commit 34c3b12fd58fc1833abd20eb7b222cb6561e1b03) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix missing report entriesAlexey Edelev2020-12-291-1/+2
| | | | | | | | | | | Use LESS_EQUAL condition since qt_configure_command_count stores last added command index but not actual count Fixes: QTBUG-88054 Change-Id: I8112820f9885bdad5a786a4f6b4890d8f2fbe14b Reviewed-by: Cristian Adam <cristian.adam@qt.io> (cherry picked from commit 642ee46f98c6b3cd98a323f7dc5cac3a738b066c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Store config summary to fileAlexey Edelev2020-12-291-0/+5
| | | | | | | | | | Add generation of qmake-like config.summary in build folder Fixes: QTBUG-87830 Change-Id: I08dd9b3116c6200f7e9f5de96605118c1ea474ad Reviewed-by: Cristian Adam <cristian.adam@qt.io> (cherry picked from commit 6baf36d77432dc56a47e50f59ccde93b73cfe204) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Add --enable-new-dtags flag supportAlexey Edelev2020-12-221-0/+4
| | | | | | | | | | | | | | Remove enable-new-dtags from feature mapping, handle it as regular feature. Regenerate configure.cmake with 'enable-new-dtags' enabled. Check for enable_new_dtags feature, add -Wl,--enable-new-dtags if enabled. Fixes: QTBUG-89013 Change-Id: Ice57c02dc85f7f9ecf14e3bc65f31a57b589ce24 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Craig Scott <craig.scott@qt.io> (cherry picked from commit bbebfa0be2e51b638459d6d812e4db25a65a0d6d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Use Release build type by defaultAlexey Edelev2020-12-211-7/+7
| | | | | | | | | | | | Use developer-build feature to set Debug build by default instead of .git folder detection Task-number: QTBUG-89410 Fixes: QTBUG-89476 Change-Id: I2a4f529299d4875e7b0eef5b41dd7a6b9402178b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit b4b33846b4dc703e637b7d365676345eda0da460) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Use host variables instead of hardcoded directoriesAlexey Edelev2020-12-217-12/+23
| | | | | | | | | | | | | | | | | | | | 'QT_HOST_PATH' indicates that we use crosscompilation toolchain to build project. In this case 'Qt6Config.cmake' loads 'Qt6HostInfoConfig.cmake' from host QT_HOST_PATH, that defines correct paths to host tools. Replace hardcoded paths for host tools by paths recorded in Qt6HostInfoConfig.cmake. Correct conditions for QT_HOST_PATH, evaluate it explicitly as string, but not as boolean expression. Fixes: QTBUG-86557 Change-Id: Ib52bbd32478051d019a932dcb1f735e2d4aacfbf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 56bdef94379479f27858dccc73a95614648735bb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Add detection of FEATURE_foo change by userAlexey Edelev2020-12-183-32/+67
| | | | | | | | | | | | | | | | | | | | | | Unset all QT_FEATURE_foo values for every build. If any of FEATURE_foo is different of QT_FEATURE_foo, mark whole Qt build as dirty. Reset FEATURE_foo for dirty builds to the calculated value if it doesn't meet its condition. Set Qt module as NOT FOUND if its target was not created during configuration. Main issue with this approach are generated files, that became trash once the related features are disabled. This especially affects features that enable/disable Qt modules. FooConfig.cmake files are created and generate lots of warnings if feature was disabled. We may introduce a module cleanup procedure at some point. Fixes: QTBUG-85962 Change-Id: Id71c1edb4027b24c6793063e40cc9d612c24ebce Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 61943aefd68b7d88c5eb395c4e44d08a94a70ad0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix module separate build error when -DFEATURE_static_runtime=ONLi Xinwei2020-12-171-9/+9
| | | | | | | | | | | | | | | | | | | Build qtbase with -DFEATURE_static_runtime=ON, and then separately build another module, following build error occurs: error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease'. That's because all the sources in this module are compiled with 'MD'. When separately building a module except qtbase, FEATURE_static_runtime is not exist in cmake cache. So we should use QT_FEATURE_static_runtime instead of FEATURE_static_runtime in qt_set_common_target_properties. Additionally, adjust the indentation. Change-Id: I2cf4737db9d3e8533570039a66c7d277d62a8d14 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 970e54c63d487ff5a334b8037ce0890fceb24e0f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix compile warnings when MSVC and -DFEATURE_static_runtime=ONLi Xinwei2020-12-171-0/+2
| | | | | | | | | | | | | | When using MSVC compiler and -DFEATURE_static_runtime=ON, qrc_foo.cpp and qtentrypoint_win.cpp are still compiled with '-MD' or '-MDd' flag, which will cause following warnings and other possible problems: warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library Change-Id: I6794930a64e9cff4dc1c9632fc3fc64227848af0 Reviewed-by: Yuhang Zhao <2546789017@qq.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 21e4e85a5798884837b35859f73f1eca4cb976d2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix autotest config in cross-compiled prefix buildEirik Aavitsland2020-12-171-1/+5
| | | | | | | | | | | qt-cmake-standalone-test would be looking for the config files under the target machine install prefix instead of under the staging prefix on the build host. Change-Id: I29850af6d8fe502f4944f689ec10539d17ccdcb9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit e26d2865a718cecd08233e84673c67c5ca3bc765) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: install android test scripts to libexec to test on all modulesAssam Boudjelthia2020-12-111-0/+9
| | | | | | | | | | | | The scripts that are used by Android test VMs are now located in qtbase and are not easily usable by other modules. To fix that and allow other modules to use those scripts, we install them with cmake into libexec. Task-number: QTQAINFRA-4052 Change-Id: Ibdd3658fd9fe7e007104a85d9999028a2de99a33 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit f3cfdb905b926948659f37924837b3c14868ff6a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Wrap benchmarks with cmake scriptAlexey Edelev2020-12-111-42/+57
| | | | | | | | | | | | | | | | | Wrap benchmark executable target with cmake script to run it on windows without necessity of environment variables set. Move common logic related to test and benchmark environment to 'qt_internal_collect_command_environment' function. Make error message of wrapper script a bit more verbose. Amends 61d5b019727dd1c06366205cb307a2a928a2a29c Task-number: QTBUG-89076 Change-Id: I6ad3a027dc071176070cf3af4cf306f20d652039 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit cb43c7176b882b33f352fbbab0ea4ba0b5cf66dc)