summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* 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 Pick-to: 6.1 6.0 Change-Id: I05e2a90b4d7f2120b0198e3fb7b8b1b2398eba93 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* 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 Pick-to: 6.0 6.1 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>
* configure: Don't guess the compiler if the user already chose oneJoerg Bornemann2021-02-111-4/+41
| | | | | | | | | | | | We must not guess the compiler from the -platform argument if one of the following holds: - the CXX/CC environment variables are set - the CMAKE_CXX_COMPILER/CMAKE_C_COMPILER variables are passed Pick-to: 6.1 Fixes: QTBUG-90914 Change-Id: Iff7a0e7b8857f77333f1705f118d7952af5234ba Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: setup windows tools path only when building on WindowsSamuli Piippo2021-02-111-1/+1
| | | | | | | | | | | Fix cross-compilation on Linux host. Task-number: QTBUG-91052 Pick-to: 6.1 Change-Id: I48c970f0e6af71e3eda3818557e764f60d3836ad Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix FindWrapOpenSSL.cmake if OpenSSL::Crypto is UNKNOWN_LIBRARYJoerg Bornemann2021-02-111-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. Pick-to: 6.1 6.0 Fixes: QTBUG-90925 Change-Id: Idbc1379c89480225fc7a8d417416ed20404a1122 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* More helpful error message when merging qt features in CMakeAndreas Buhr2021-02-101-1/+1
| | | | | | | | | | When a feature is set in qtbase and is later set to another value, an error occurs and an error message is given. This patch changes the error message to contain both the preexisting and the new value Change-Id: Ifa9fc1f06bfde40e8fd5dfdf30165d4393abbd28 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* 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. Pick-to: 6.0 6.1 Change-Id: Ib9cfa7edc864d7d540577df22284ceb9714a2511 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Update name of c++2a to c++20Kai Köhne2021-02-102-2/+2
| | | | | | | | | | Keep the c++2a feature, but make it an alias for compatibility purposes. Pick-to: 6.1 Change-Id: I6f153109be84659806f1b7a57a88a187875166d8 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* CMake: Rename QML2 imports to QML importsUlf Hermann2021-02-081-1/+1
| | | | | | | | The 2 is meaningless. Task-number: QTBUG-85064 Change-Id: Ic91872804be266d50224fb272b4f4836573f4bf7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* 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). Pick-to: 6.0 6.1 Fixes: QTBUG-90946 Change-Id: Icec93ffc0dc80d9ac7cf6cf1b13824bc2a1e795f Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* 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 Pick-to: 6.0 6.1 Change-Id: I8e038e08d83016e8253f2e83b2efb8f06034c6cd Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Allow benchmarks with --force-debug-infoAllan Sandfeld Jensen2021-02-051-1/+1
| | | | | | | | Developer builds with RelWithDebInfo should also make benchmarks, it is how we get good traces. Change-Id: I009d40580d5d784f78bd18ebf21887ce3c1fa97d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add framework paths when generating moc manuallyAlexey Edelev2021-02-051-0/+20
| | | | | | | | | | | In apple systems it's necessary to pass the framework paths to the moc generator to resolve required header files. We need to collect framework paths for all INCLUDE_DIRECTORY_TARGETS and add them to the command line of the moc generator. Task-number: QTBUG-84906 Change-Id: I9e6356e7e0a5f2493823ec764a48b0b8f1c8c10d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix HAVE_openssl config test when using static OpenSSLLi Xinwei2021-01-281-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 Pick-to: 6.0 Change-Id: I5f27790b251d0a0f71aaf2aed2b933aeb3326f1f Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Clear non-relevant CMake compiler flagsAlexey Edelev2021-01-275-28/+104
| | | | | | | | | | | | | | | | Add internal function to cleanup compiler flags out of the CMAKE_xxx_FLAGS_xxx variables. Use introduced interface to clear the '/EHsc' flag for the MSVC compiler family. This adjusts the CMake behavior to the qmake one. Change the 'EXCEPTIONS' option handling in helper functions. Add ability to add enabling and disabling exception flags. Previously it was only possible to add disabling exception flags. Fixes: QTBUG-89952 Change-Id: I60d47660a97ae9b5a1d1f4107d352c9e97890144 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* 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. Fixes: QTBUG-90529 Change-Id: Ifa5d6b97e07fc4e249c58cda5128439d60b14f5f Reviewed-by: Kai Koehne <kai.koehne@qt.io> (cherry picked from commit 54980200c79b466a276a4d3054390e4b3162e9ed) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QT_TOOL_PATH_SETUP_COMMANDJuha Vuolle2021-01-271-1/+1
| | | | | | | | | | | | | | Commit 18fc9e1bf821130f0cfe45dc7d5c05b70458e7c0 introduced a Windows-only QT_TOOL_PATH_SETUP_COMMAND to make it possible to call the tool of a module while building the module itself. The "set PATH=..." command in QT_TOOL_PATH_SETUP_COMMAND was flawed, because it contained escaped double quotes which made the set command ineffective. Fix this by removing the escaping of the double quotes. This was uncovered when porting qtscxml to CMake. Change-Id: I5909aa841e7895d6d0feb4037a935b805ccfdc99 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* ibase: Fix the compilation and include it again so it can be detectedAndy Shaw2021-01-261-0/+51
| | | | | Change-Id: I38721155f090173862da8beab8cb04b2e015dcff Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Fix invalid Qt prefix version when looking for HostInfo moduleAlexey Edelev2021-01-263-12/+12
| | | | | | | | | | | | | | | | | | | In QtSetup.cmake the PROJECT_VERSION_MAJOR variable was used to identify prefix of 'Qt<version>HostInfoConfig.cmake'. Qt<version>HostInfo is not found, if project version differs from qtbase version. Move the 'INSTALL_CMAKE_NAMESPACE' and 'QT_CMAKE_EXPORT_NAMESPACE' variables to 'QtBuildInternalsConfig.cmake'. In this case variables will be exposed for a wider list of internal routines. Use the 'INSTALL_CMAKE_NAMESPACE' variable as prefix to find Qt<version>HostInfo module. Fixes: QTBUG-90345 Change-Id: Ic595d1c5beb74f34e69b58e18590a3afc2f346f7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add upstream version of FindPostgreSQL.cmakeAlexey Edelev2021-01-261-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>
* Ensure consistent flags for ASM language and MODULE targetsCraig Scott2021-01-261-2/+2
| | | | | | | | | | | | | | | | | | | By not including ASM in the languages for which compiler flags are adjusted, we can end up with inconsistent optimization and debug settings between different languages. Make sure they are treated the same. Similarly, linker flags for MODULE target types should also have their debugging and incremental linking flags adjusted, just like EXE and SHARED targets. When building with MSVC, MODULE targets were having the relevant flags stripped, but not then replaced with the desired ones, leaving them empty in typical scenarios. This would primarily affect plugins, which are built as MODULE rather than SHARED libraries. Fixes: QTBUG-90237 Change-Id: I648ea74be1654d24cbecc592ce0ca4b59b2ae839 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* 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. Pick-to: 6.0 Change-Id: If62cb966b41b7452edb5b63725756916b66affac Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Bump copyright year to 2021Kai Köhne2021-01-251-1/+1
| | | | | | Change-Id: I18a9c2de391ca51655148b2e3cc9abdfbb8ddbcf Reviewed-by: Tarja Sundqvist <tarja.sundqvist@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix QMAKE_PRL_LIBS entries on Windows for modules from other reposJoerg Bornemann2021-01-221-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. Pick-to: 6.0 Fixes: QTBUG-90520 Change-Id: Id0d9178da0e0dfc3ea4fadbbe8f5900d792ffc84 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Tune compilation flags to reduce libraries sizeAlexey Edelev2021-01-222-1/+15
| | | | | | | | | | | | Add '_WINDLL' definition for the MSVC compilers family. Check the 'FEATURE_optimize_size' value before replacing compiler flags in the qt_internal_add_optimize_full_flags function. This is required, because Qt::Core and Qt::Gui modules lost their ability to shrink, when selecting the appropriate build type or features. Fixes: QTBUG-89952 Change-Id: I982c25ea84e4793b4006ead0ee516b3f3eb2a054 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix static top-level buildJoerg Bornemann2021-01-221-7/+7
| | | | | | | | | | | | | | Commit d0071a4f871 broke static top-level builds: CMake Error at .../qtbase/lib/cmake/Qt6Gui/Qt6GuiPlugins.cmake:17 (set_property): set_property can not be used on an ALIAS target. Fixed by moving the un-aliasing of the target before the set_property call. Pick-to: 6.0 Change-Id: I96c731353798a58ff9b3a664f3614ef03c897dcb Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Only generate and add static plugin imports once per module targetCraig Scott2021-01-211-2/+18
| | | | | | | | | | | | | | | | | | | Projects may call find_package(Qt6 ...) multiple times. When enabling examples and tests, this happens a lot. For a statically built Qt, for modules that have plugins (e.g. Gui), every time the module's config file was loaded, it was generating and adding another copy of the import plugin sources to the module target. These accumulated and created many duplicates, which in turn blew out generation time and made the build very inefficient. This change checks whether the import plugin sources have already been processed for the module target and ensures they are only added once. It records its status on the target itself so that both local and global targets are supported. Fixes: QTBUG-90465 Change-Id: I1f45b1ee771a933ee755d44f1e983d6d9113dad0 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Do not export the QT_PLUGINS target property of Qt modulesJoerg Bornemann2021-01-202-3/+2
| | | | | | | | | | | This property is dynamically determined and set in the Qt6${module-name}PluginsConfig.cmake files now. There is no need anymore to export this property. Change-Id: I2d164864c4099034b88f9ad852eae8b9f9e55f8b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Fix loading of Qt6*Plugin.cmake files of per-repo buildsJoerg Bornemann2021-01-202-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When doing a per-repository build of Qt, as it is done for the installer packages, the build of qtbase has no knowledge of plugins that might be built and installed from other repositories. That means we must not write a fixed list of known plugins when exporting Qt modules of qtbase. In particular, qtsvg adds imageformat plugins that are supposed to be picked up by qtbase's QtGui module when linking a project against a statically linked Qt. ${install-prefix}/lib/cmake/Qt6Gui/Qt6GuiPlugins.cmake missed the include statements for qtsvg's plugin config files and operated on a fixed list of plugins, all from qtbase. Apart from that, the Qt6::Gui target's property QT_PLUGINS did only contain the qtbase plugins. This patch fixes the situation in the following way: 1. All Qt6*PluginConfig.cmake files in ${install-prefix}/lib/cmake/Qt6Gui are detected and included. 2. From those file names, the target names of the plugins are deduced. This is safe as the file name of those generated files is a direct result of the plugin's target name. 3. The QT_PLUGINS property of the module is updated with the detected plugin target names. Fixes: QTBUG-89643 Change-Id: Ifc3c39aa9948277ead5ebb209ec5eff64746308b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Add arguments to 'qt_manual_moc' to resolve 'moc' includesAlexey Edelev2021-01-201-1/+19
| | | | | | | | | | | | | | 'qt_manual_moc' doesn't provide include paths for 'moc' command to substitute required macros. This change adds the 'INCLUDE_DIRECTORIES' and 'INCLUDE_DIRECTORY_TARGETS' arguments to the 'qt_manual_moc' function. If 'INCLUDE_DIRECTORY_TARGETS' is specified, 'qt_manual_moc' collects 'INTERFACE_INCLUDE_DIRECTORIES' of provided targets and uses them as the 'moc' include directories. Change-Id: I58c8887dae3ca2484574c5e12e2cbd47f5bd3648 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Use private headers for internal module priJaeyoon Jung2021-01-201-0/+2
| | | | | | | | | | | | Just like config_module_name is appended by "_private" in the case of internal module pri, replace module_includes with the private one. It fixes the issue where a pro file that uses an internal module pri does not build due to missing paths to private headers. Fixes: QTBUG-89961 Change-Id: Ice16a1e9f709d29454f1ddf5b954673cc06a88bb Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Jaeyoon Jung <jaeyoon.jung@lge.com>
* cmake: Bail out in case syncqt failed to runKevin Funk2021-01-201-1/+4
| | | | | | | | | | | | | | Make sure to react on failed syncqt runs during the CMake run. CMake will now report something along this: ``` syncqt couldn't parse .../qt5/qtbase/sync.profile: Can't modify modulus (%) in scalar assignment at .../qt5/qtbase/sync.profile line 25, near ");" CMake Error at qtbase/cmake/QtModuleHelpers.cmake:192 (message): Failed to run syncqt, return code: 255 ``` Change-Id: I575a5fc926c547b6b633583e5d675f7e35beb734 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* 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. Pick-to: 6.0 Fixes: QTBUG-90402 Change-Id: I27de8b3cc816488c2716042383b334d5c421452d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move UNICODE and _UNICODE definitions to internal platform targetAlexey Edelev2021-01-192-1/+5
| | | | | | | | | | Move UNICODE and _UNICODE definitions from the public Qt::Platform target to the private Qt::PlatformCommonInternal target. Fixes: QTBUG-89951 Change-Id: Ib4c1c4cab74acda0a43c4ddb3cffd3954393dc89 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Adjust database packages FindFoo.cmake files to CMake conventionAlexey Edelev2021-01-193-36/+41
| | | | | | | | | | | Replace package _LIBRARIES by _LIBRARY and _INCLUDE_DIRS by _INCLUDE_DIR. Move find_package_handle_standard_args for Oracle and DB2, since this call should set _FOUND variable but not separate condition. Fixes: QTBUG-89866 Change-Id: I54be2c2c4d7ba4b849a27139702861ecd937c444 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* 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. Pick-to: 6.0 Fixes: QTBUG-90039 Change-Id: I68ec7125b538a57567035e7adb8dac3b213f95e6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* FindLibb2: Don't rely solely on pkg-configCraig Scott2021-01-181-3/+33
| | | | | | Task-number: QTBUG-86283 Change-Id: Ie455d7cfc6e6f9ae8297f8bc0daf2816ccce91b6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make -pkg-config configure option actually workCraig Scott2021-01-181-0/+6
| | | | | | | | | | | The QtBuildInternals config package file gets processed before feature evaluation occurs. That means INPUT_pkg_config may be defined, but the corresponding FEATURE_pkg_config variable won't have been set/updated yet. Do this check locally because the availability of a number of features is conditional on whether pkg-config is available. Change-Id: I6030eb380ee0c630ffbe5db5eed397a46227c7f6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix missed feature evaluation errors in reportAlexey Edelev2021-01-152-4/+10
| | | | | | | | | | | | Add an optional argument to store the report command while feature evaluation-only stage. This is necessary, because according to the actual feature evaluation process, evaluation happens only once and it's impossible to record any command during the evaluation-only stage. Fixes: QTBUG-90319 Change-Id: I215fbe0a28a2661cd2d97d253b2e2c787d295cbd Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* CMake: add CoreLocation framework for macOSIvan Solovev2021-01-151-0/+1
| | | | | | Task-number: QTBUG-89854 Change-Id: Icd52a6dd0ae36ae91599ab9a583e6920f2d2ba4c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Prevent compiler and linker flags from growing every cmake runCraig Scott2021-01-151-157/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Functions in QtFlagHandlingHelpers.cmake try to update the CMake cache variables for compiler and linker flags. These were using the current value of those variables and writing the modified ones back to the cache every time CMake ran. If a toolchain file sets or modifies any of these variables, that updated value is used and written back into the cache instead of the original cache variable's value. The next time CMake executes, the toolchain file re-applies the same change and the variable grows longer each time with flags repeated. With Ninja, this causes a complete rebuild every time CMake is re-run. The Android NDK toolchain file is one example where this behavior is triggered (the fault is shared, one could argue that the NDK should only be setting ..._INIT variables, but that's out of our control). Another related bug in the previous implementation was that the flags used to build after the first CMake execution could be different to those used for all builds after the second and later CMake runs. This is because the CMake cache was being updated, but not always the calling scope of the functions that modified them. If a toolchain file set any of the compiler or linker flag variables as non-cache variables, then updating the cache variable would have no effect on the calling scope. The non-cache variable would continue to take precedence for that scope for that run. The next time CMake executes though, the updated cache variable would now have been used by the toolchain file and the change *will* be part of the non-cache variable's value. The above are examples of why you should try to avoid updating these cache variables from project code. We could leave the cache alone and always update only non-cache variables, but then a developer looking at the cache may wonder why the values they see there don't match the values being used in builds. Or worse, they think the cache values are being used and don't realize the builds are using something different. Ultimately, we have to choose which downside we are happy to live with. The changes here preserve the previous intent of updating the cache, but it's still a bit fragile. Fixes: QTBUG-89821 Task-number: QTBUG-85992 Task-number: QTBUG-86866 Change-Id: I8a16753e159bde338e6d2e5dd2ce91fc8ac5c39d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* 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. Pick-to: 6.0 Change-Id: Ia918b9f2b494508e86301ffc0e138d3ad4dbaf86 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* 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 Pick-to: 6.0 Change-Id: Ie5f48178803a270f6d94408f7a8e85d379eb123c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* 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'. Pick-to: 6.0 Change-Id: Ie990fc0b0bf2c19b119c7c4e2aeec092e5200103 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: improve FindMySQL.cmakeLi Xinwei2021-01-091-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 Pick-to: 6.0 Change-Id: I6bdf195b8976c59230a12af335a838af55df0caf Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* 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. Pick-to: 6.0 Change-Id: I63b2de0047005419d352ea259dec6f17a826a477 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add newline to the end of the config.summaryAlexey Edelev2021-01-081-0/+1
| | | | | | | | Amends 94b6bec01f250065b28d5528ea9239bafd5253e5 Pick-to: 6.0 Change-Id: I0d4be9c7f9aff071468a66d7940d6cd2488136ca Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Fix qch install pathAlexey Edelev2021-01-071-1/+1
| | | | | | | | | Exclude qch_file_name from install DESTINATION Fixes: QTBUG-89769 Pick-to: 6.0 Change-Id: I8dba13a0a2c2c92d6b2d6aa438c295b42a04156b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add 'oci' to possible Oracle Client library namesAlexey Edelev2021-01-061-1/+1
| | | | | | | | In latest Oracle Instant Client releases for windows the OCI library name is 'oci.dll'. Add it as option to find_library call. Change-Id: I6e6f4a998207d16583a380c1bd95db857051606b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* 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 Pick-to: 6.0 Change-Id: I6dba589bb59ad69fa07221c657df272ec75c359b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>