summaryrefslogtreecommitdiffstats
path: root/configure.cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: pro2cmake: Specify library versions for 3rd party librariesAlexandru Croitor2020-08-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | If certain 3rd party libraries have a version that's not suitable for Qt, the configure summary should say so, rather than use them and fail at build time. With the current situation, we have to duplicate the version information from the configure.json files in helper.py, by assigning the version number as an extra find_package variable. Rerunning configurejson2cmake then embeds this version info into the qt_find_package calls in configure.cmake. Some of the Find modules are rewritten to take the specified version into account when looking for the libraries. This involves moving around the code for creating a target, after calling find_package_handle_standard_args() so we know if a good enough version was found. Task-number: QTBUG-82917 Change-Id: I139748d8090e0630cda413362760034dc3483e11 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make -qtlibinfix affect the names of plugins by defaultJoerg Bornemann2020-07-131-6/+0
| | | | | | | | | | | | | | | | In Qt5, the -qtlibinfix option did not affect the naming of plugins, unless -qtlibinfix-plugins was set. This option was added in 56416509930 to offer a way to have -qtlibinfix affect the plugin names without changing the default behavior. We now remove the -qtlibinfix-plugins option, as the old behavior is not desirable. [ChangeLog][configure] The -qtlibinfix option now affects the names of plugins. The -qtlibinfix-plugins configure option was removed. Task-number: QTBUG-15192 Fixes: QTBUG-85439 Change-Id: I96f5c2577b76274929c431621967df0e9b4631b7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Generate qdevice.pri when cross-buildingJoerg Bornemann2020-06-291-0/+3
| | | | | | | | | | | | | This adds the CMake equivalent to the classical -device-option key=value configure argument: -DQT_QMAKE_DEVICE_OPTIONS=key1=value1[;keyN=valueN] The keys and values get dumped verbatim into qdevice.pri. This patch also ports the machineTuple configure test. Its result is written into qdevice.pri as value for the GCC_MACHINE_DUMP variable. Change-Id: I29f2323fd87639fafaed99ec7446c7ee75504705 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Improve sanitizer detectionAlexandru Croitor2020-06-151-0/+25
| | | | | | | | | | | | | | | The change fixes the labels to show up correctly in the configure summary. It also allows enabling the sanitizer via the feature flags, e.g. -DFEATURE_sanitize_address=ON. Finally the qtbase sanitizer option is saved in QtBuildInternalsExtra so that repos built after qtbase have the same sanitizer options enabled. Change-Id: Ic9d9e3ce3c7ebbc244ced2e6d163d1ac8ee06b12 Fixes: QTBUG-84721 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix usage of gc_binaries featureAlexandru Croitor2020-06-121-0/+3
| | | | | | | | | | | | | | | | The qt_internal_apply_gc_binaries function should apply both compile and link flags, not just link flags. The flags should be applied publically to all consumers of Bootstrap regardless if the gc_binaries feature is enabled. The flags should be applied publically to Core only in case if the feature is enabled (aka for static builds only). Change-Id: Id42af0d9b527004d74c04eff2c9e3c2be1e76aac Fixes: QTBUG-84461 Task-number: QTBUG-83929 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Remove winrtOliver Wolff2020-06-061-4/+4
| | | | | | | | | Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Regenerate rest of configure.cmake filesAlexandru Croitor2020-05-291-0/+23
| | | | | | Change-Id: I17cca57c18f33d4283eb6009ba4c5ebb0c1847c3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Generate information about 3rdparty libs in module .pri filesJoerg Bornemann2020-05-191-4/+4
| | | | | | | | | | | | | For modules that are not yet ported to CMake and that use QMAKE_USE += libfoo we need to provide the information about libfoo in the qt_lib_XXX.pri files. Also, we now generate qt_ext_XXX.pri files for bundled 3rdparty libs. Task-number: QTBUG-75666 Change-Id: I9e4b057a197554ecb37c294c0bf09e2a2b3aa053 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Don't enable -headerclean by default even for developer buildsLars Knoll2020-05-141-1/+1
| | | | | | | | The CI system can test this, but there's little reason to blow up every developers compile time by 30%. Change-Id: I7677b0411103fb1301ad087c884cc9bd22a5aee2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Port the 'static_runtime' featureJoerg Bornemann2020-04-231-0/+8
| | | | | | | | | | This feature is Windows-only and must be turned on manually. For MSVC it sets the MSVC_RUNTIME_LIBRARY target property. For MinGW it adds the -static linker flag. Change-Id: I9da3b88d545b34bc34a3a80301b2dd1b5986fa88 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Port the 'pkg-config' featureJoerg Bornemann2020-04-211-0/+7
| | | | | | Change-Id: If571208aaaba8c1d0af834e8ae11869872d42135 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* CMake: Port the 'ccache' featureJoerg Bornemann2020-04-171-0/+6
| | | | | | | This maps to the CMake variable QT_USE_CCACHE. Change-Id: I3258027301284d907f6ecde6c65d2c0dde8f0a11 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Port the 'ltcg' featureJoerg Bornemann2020-04-171-0/+6
| | | | | | | This maps to the CMake variable CMAKE_INTERPROCEDURAL_OPTIMIZATION. Change-Id: Id0ce48f176b95c27e74ab80276e89503b1660f79 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Port the 'cross_compile' featureJoerg Bornemann2020-04-171-0/+6
| | | | | Change-Id: Iccd1d55e95797740a4a8689462ce9ab1e49a62c1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Handle automatic rpath embedding correctlyAlexandru Croitor2020-04-171-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using CMAKE_INSTALL_RPATH to embed an absolute path to prefix/libdir into all targets, use the more sophisticated aproach that qmake does. For certain targets (modules, plugins, tools) use relative rpaths. Otherwise embed absolute paths (examples, regular binaries). Installed tests currently have no rpaths. On certain platforms rpaths are not used (Windows, Android, iOS / uikit). Frameworks, app bundles and shallow bundles should also be handled correctly. Additional rpaths can be provided via QT_EXTRA_RPATHS variable (similar to the -R option that configure takes). Automatic embedding can be disabled either via QT_FEATURE_rpath=OFF or QT_DISABLE_RPATH=ON. Note that installed examples are not relocatable at the moment (due to always having an absolute path rpath), so this is a missing feature compared to qmake. This is due to missing information on where examples will be installed, so a relative rpath can not be computed. By default a Qt installation is relocatable, so there is no need to pass -DQT_EXTRA_RPATHS=. like Coin used to do with qmake e.g. -R . Relative rpaths will have the appropriate 'relative base' prefixed to them (e.g $ORIGIN on linux and @loader_path on darwin platforms). There is currently no support for other platforms that might have a different 'relative base' than the ones mentioned above. Any extra rpaths are saved to BuildInternalsExtra which are re-used when building other repositories. configurejson2cmake modified to include correct conditions for the rpath feature. It's very likely that we will need a new qt_add_internal_app() function for gui apps that are to be installed to prefix/bin. For example for Assistant from qttools. Currently such apps use qt_add_executable(). The distinction is necessary to make sure that relative rpaths are embedded into apps, but not executables (which tests are part of). Amends e835a6853b9c0fb7af32798ed8965de3adf0e15b Task-number: QTBUG-83497 Change-Id: I3510f63c0a59489741116cc8ec3ef6a0a7704f25 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Port the 'static' featureJoerg Bornemann2020-04-061-0/+5
| | | | | | | | Now that we have the 'shared' feature implemented we can easily port the 'static' feature. Change-Id: Ia9b54b68d532d73c3d62d12a86c9e8b83e7909c8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: configurejson2cmake: Port precompile_header featureAlexandru Croitor2020-04-061-1/+7
| | | | | | | | | | | We don't need the test, we can just check the value of BUILD_WITH_PCH to know whether the feature is enabled. Regenerate configure.cmake files. Change-Id: I5691a22af2913bc398f99825e0c41cf2daf5a587 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Report which qt parts will be built by defaultAlexandru Croitor2020-04-021-0/+1
| | | | | | | | | Like libs, tools, examples, tests. Built by default means they are part of the default make / ninja target. Change-Id: I304e5724fc5dbd39626e9d589a6e1e92a4dd7882 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Define QT_STATIC for static buildsJoerg Bornemann2020-04-011-0/+1
| | | | | | | | | | QT_STATIC must be defined for static builds to have the right import/export symbol macros defined. Originally, this macro is wrapped in a condition. That's why we extend qt_feature_definition to be able to write a prerequisite to qconfig.h. Change-Id: I610e60acc7f5bdc031eff6d53a76e0b229a5c8c2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Port the 'rpath' featureJoerg Bornemann2020-04-011-0/+6
| | | | | | | | This is needed for qmake mixing. Change-Id: I368169606606a8de4dc8f2db5b98660a0a2fa349 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* CMake: Add support for bundled SQLite libraryLeander Beernaert2020-03-251-0/+9
| | | | | Change-Id: I4d3f6e3bf04eb2fcf337e2c5dbc04b6e6f8ebe0b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: "Port" the c89, c99 and c11 featuresJoerg Bornemann2020-03-231-0/+11
| | | | | | | | We can ignore the tests for those features and directly ask CMake whether the compiler supports the respective language version. Change-Id: I31cd35493443fea0c6d0b0a5e641768c3bcbe736 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Regenerate projectsAlexandru Croitor2020-03-161-2/+2
| | | | | Change-Id: I0cd4f34b0df0227789805f30f474ff6aa275078f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* cmake: Remove APPLE prefix from platform namesTor Arne Vestbø2020-03-161-6/+6
| | | | | | | None of the other platforms have it. Change-Id: Ib448c2c03ba03f711b507ef391977c0e6aa7c192 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Disable framework builds on macOS when target config is DebugAlexandru Croitor2020-03-091-1/+1
| | | | | | | | | | | | | | This prevents Coin from trying to automatically enable the framework feature when no configuration is specified on the command line. By default if no configuration is specified, and there's a .git subfolder, "Debug" will be the chosen config, and that would conflict with the framework feature, which would cause configuration to fail. Change-Id: Ia9db3e8178794737692307b4662a2e77cc574ccd Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Regenerate configure.cmake files to get reportsAlexandru Croitor2020-03-091-1/+145
| | | | | Change-Id: Ifa1646c7e471b3eaba552498ee1dc24f6ab864de Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Port the 'separate_debug_info' featureJoerg Bornemann2020-03-061-0/+10
| | | | | | | | | | | | | | | For this, we have to uninline the separate_debug_info configure test, because supporting the conversion of this in configurejson2cmake is not worth the hassle. Separate debug information can be turned on for a target by calling the function qt_enable_separate_debug_info. For Qt's shared libraries and tools separate debug information is generated if the 'separate_debug_info' feature is manually turned on. Change-Id: Ic2ffc15efef3794dc0aa42f3d853ef6d651a751c Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix condition of the 'debug' featureJoerg Bornemann2020-03-061-1/+1
| | | | | | | | For the moment, in feature conditions that use STREQUAL, the lhs must be a variable. Change-Id: I56fe24baeb8067662ea81984fd48383da4c5b67b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Port the 'force_debug_info' featureJoerg Bornemann2020-03-051-0/+5
| | | | | | | | | | This feature is read-only and is ON if CMAKE_BUILD_TYPE is RelWithDebInfo or if that value is in CMAKE_CONFIGURATION_TYPES. It mainly exists for the qmake support. Change-Id: I25cb57e832dcfcab100834a104b1a3d34f01086b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Port the 'debug_and_release' featureJoerg Bornemann2020-03-051-0/+6
| | | | | | | | This feature is read-only. It's controlled by the multi-config feature of CMake. It mainly exists for the qmake support. Change-Id: I322459598fe92568eda4d42319ded444537e95d4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Port the 'shared' featureJoerg Bornemann2020-03-051-0/+7
| | | | | | | | This feature is read-only and supposed to be set by BUILD_SHARED_LIBS. It mainly exists for the qmake support. Change-Id: I722b0de53211d0aab1924e45a77120c890f31f50 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Port the 'debug' featureJoerg Bornemann2020-03-051-0/+5
| | | | | | | | This feature is read-only and supposed to be set by variables like CMAKE_BUILD_TYPE. It mainly exists for the qmake support. Change-Id: Ic7e32cbda0f3c2d92dd446b07a3bf1a8d85ec3b9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix stack-protector-strong test and featureJoerg Bornemann2020-03-041-2/+6
| | | | | | | | | And in order to do this we must teach qt_config_compile_test a COMPILE_OPTIONS argument. Change-Id: I66fa45142b544e3a2fc599af1c1a4c69b442b318 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-031-0/+1
| | | | Change-Id: If36d96c0fef3de5ab6503977501c55c62a2ecc97
* CMake: Port the reduce-relocations featureJoerg Bornemann2020-02-251-0/+6
| | | | | | | | | | As reduce-relocations implies bsymbolic_functions, we also add the -Bsymbolic-functions linker flag. Also, handle the .dynlist files that are passed to the linker by bsymbolic_functions.prf in the qmake build. Change-Id: I535c33fba888596d2f8975b16864bbe9f0a7caa4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Allow building bundled 3rd party libraries in qtbaseAlexandru Croitor2020-02-251-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few things are needed to accomplish that: - the python scripts do not ignore certain system_foo features anymore (it is a hardcoded list for now just to be safe) - configurejson2cmake now outputs qt_find_package(WrapSystemFoo) calls for bundled libraries (see below) - the harfbuzz .pro file is modified to accommodate pro2cmake not being able to correctly parse some conditional scopes - the freetype .pro file is modified to make sure linking of the library succeeds without duplicate symbol errors, which qmake doesn't encounter due to magical exclusion of cpp files that are included in other cpp files (presumably for include moc_foo.cpp support) - feature evaluation for Core, Gui, Network now happens in the qtbase/src directory, so that bundled libraries can be conditionally built - for each bundled library there are now two FindWrap scripts: - FindWrapSystemFoo which finds an installed library in the system - FindWrapFoo which either uses the system installed library or the built bundled one depending on a condition - projects that intend to use bundled libraries need to link against WrapFoo::WrapFoo instead of WrapSystemFoo::WrapSystemFoo targets (this is handled by pro2cmake). Unfortunately manually added qt_find_package(WrapFoo) calls might still be needed as is the case for WrapFreetype and others. - a new cmake/QtFindWrapHelper.cmake file is added that provides a macro to simplify creation of WrapFoo targets that link against a bundled or system library. The implementation is fairly ugly due to CMake macro constraints, but it was deemed better than copy-pasting a bunch of almost identical code across all FindWrapFoo.cmake files. - a qtzlib header-only module is now created when using bundled zlib, to provide public syncqt created headers for consumers that need them. These are projects that have 'QT_PRIVATE += zlib-private' in their .pro files (e.g. qtimageformats, qtlocation, qt3d, etc.) This is unfortunately needed due to QtNetwork using zlib types in its private C++ API. The change includes support for building the following bundled libraries: - zlib - libpng - libjpeg - Freetype - Harfbuzz-ng - PCRE2 The following 3rd party libraries are still using an old implementation within the CMake build system, and should be migrated to the new one in the near future: - double-conversion - Old harfbuzz The are a few libraries that are not yet ported: - system-sqlite - systemxcb - maybe others Among other things, this change allows building qtbase on Windows without requiring vcpkg. Task-number: QTBUG-82167 Change-Id: I35ecea0d832f66c1943c82e618de4a51440971a5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-02-131-4/+9
| | | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/graphicsview/boxes/scene.h src/corelib/Qt5CoreMacros.cmake src/corelib/Qt6CoreMacros.cmake src/network/ssl/qsslsocket.cpp src/network/ssl/qsslsocket.h src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp src/testlib/CMakeLists.txt src/testlib/.prev_CMakeLists.txt tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp Disabled building manual tests with CMake for now, because qmake doesn't do it, and it confuses people. Done-With: Alexandru Croitor <alexandru.croitor@qt.io> Done-With: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: I865ae347bd01f4e59f16d007b66d175a52f1f152
* Post Merge FixesLeander Beernaert2020-01-241-0/+6
| | | | | Change-Id: I1e06c01b76b119c3f23b6e6ecbaae8df719b70ce Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Regenerate configure.json files after changesAlexandru Croitor2019-12-031-10/+113
| | | | | | | | | | | | Use all the original non-normalized feature names, and normalize them in CMake land rather than Python. This gives us the necessary original name information for further usage when generating qmake pri and prl files. Change-Id: If9db9028dac6175b8f6971e4b91558d76b8e9296 Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add initial support for cross-building to iOSAlexandru Croitor2019-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | Tested locally with the following configurations: - iOS device builds (arm64) - iOS simulator builds (x86_64) - iOS simulator_and_device builds (fat arm64 and x86_64 archives) All iOS builds currently require a custom vcpkg fork which contains fixes for building the required 3rd party libraries. qtsvg, qtdeclarative, qtgraphicaleffects and qtquickcontrols2 have also been tested to build successfully. simulator_and_device builds are also supported, but require an umerged patch in upstream CMake as well as further patches to vcpkg. Task-number: QTBUG-75576 Change-Id: Icd29913fbbd52a60e07ea5253fd9c7af7f8ce44c Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* Regenerate all configure.json filesLeander Beernaert2019-10-211-0/+11
| | | | | Change-Id: Iabd2430adc4877859dc73f4092927a69decf0311 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix C++ standard detectionSimon Hausmann2019-10-171-3/+52
| | | | | | | | | | | We cannot use a generator expression in an if statement, it does not work. Instead, we could inspect the CMAKE_C/CXX_COMPILE_FEATURES list, but unfortunately that's not reliable. For example it detects that ICPC supports C++17 when in fact that depends on the installed libstdc++. Therefore this patch revives our own configure tests. Change-Id: Ic3bc5762fbe81837722523e3881ac16e84628519 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Regenerate files after dev -> wip/cmake mergeAlexandru Croitor2019-10-141-3/+45
| | | | | | | | | | Note the following bigger things that had to be done: Handle GSS library / feature with a new custom find module. Implement rudimentary support for relocatability (does not currently handle extprefix). Change-Id: Ic6cd27dda7ebca9829f51cb42ea76fff6d1767ef Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix mapping of features to private featuresSimon Hausmann2019-07-221-1/+1
| | | | | | | | | | | | | | | | | | | | When a feature generates a private feature, we should not just repeat the condition but also make it depend on the original feature. In qmake features had different outputs, while we have a 1:1 mapping. For example the developer_build feature had "private_tests" as an output feature. There's no condition attached to the feature and auto-detect is off, so we'd generate qt_feature("developer_build" AUTODETECT OFF) qt_feature("private_tests" AUTODETECT OFF) and that's wrong, because when the user enables the visible feature (developer_build) we want it to propagate to the private_tests feature. Change-Id: Id8408864802fa1e1ed9e67a5f47d1d2fde38d321 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Generate the c++xx standard features instead of skipping themAlexandru Croitor2019-06-031-1/+38
| | | | | | | | | | | The features are reused in qtdeclarative (and maybe somewhere else too), so they should be present. We can still map the conditions to proper CMake compile feature tests. Change-Id: I4d307d29d4d293cc23ab005b195ea346087c7162 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Wrap DBus1 find_package call to fix xproto not being picked upTobias Hunger2019-05-101-1/+1
| | | | | | | | | | | | | | DBus1 (1.12) configuration file breaks PKG_CONFIG environment variables and will thus prevent other libraries to be picked up by pkgconfig. Main sympthom is that xproto is not getting picked up anymore, which results in hundreds of lines of warnings about this being printed. Work around that by wrapping the call to find_package(DBus1) and restoring the environment. Change-Id: Ia69f10b014dddc32045b40972500a843e5d29b38 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make zlib a required package for QtCoreAlexandru Croitor2019-05-031-0/+1
| | | | | Change-Id: Ifbb969fafe05e355d6874d8bebe2e8f1e80510ff Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Improve mapping of librariesTobias Hunger2019-05-031-1/+2
| | | | | | | | | | | | | Merge all data related to mapping libraries into one data structure in helper.py. Use that data for everything related to library mapping. This change enables way more features now like e.g. adding find_package calls into generated files. Change-Id: Ibbd2a1063cbeb65277582d434a6a672d62fc170b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: configurejson2cmake: Do not generate useless OPTIONALsTobias Hunger2019-05-031-3/+0
| | | | | | | | | | Do not set properties of packages to type OPTIONAL. That is the default anyway. Update generator script and generated files. Change-Id: I7a4d043b69c93ce8c2929a2e27ac6a07e4e6d8cc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Write find_dependency() calls in Qt Module config filesAlexandru Croitor2019-05-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces a new function called qt_find_package() which can take an extra option called PROVIDED_TARGETS, which associates targets with the package that defines those targets. This is done by setting the INTERFACE_QT_PACKAGE_NAME and INTERFACE_QT_PACKAGE_VERSION properties on the imported targets. This information allows us to generate appropriate find_dependency() calls in a module's Config file for third party libraries. For example when an application links against QtCore, it should also link against zlib and atomic libraries. In order to do that, the library locations first have to be found by CMake. This is achieved by embedding find_dependency(ZLIB) and find_dependency(Atomic) in Qt5CoreDependencies.cmake which is included by Qt5CoreConfig.cmake. The latter is picked up when an application project contains find_package(Qt5Core), and thus all linking dependencies are resolved. The information 'which package provides which targets' is contained in the python json2cmake conversion script. The generated output of the script contains qt_find_package() calls that represent that information. The Qt5CoreDependencies.cmake file and which which dependencies it contains is generated at the QtPostProcess stop. Note that for non-static Qt builds, we only need to propagate public 3rd party libraries. For static builds, we need all third party libraries. In order for the INTERFACE_QT_PACKAGE_NAME property to be read in any scope, the targets on which the property is set, have to be GLOBAL. Also for applications and other modules to find all required third party libraries, we have to install all our custom Find modules, and make sure they define INTERFACE IMPORTED libraries, and not just IMPORTED libraries. Change-Id: I694d6e32d05b96d5e241df0156fc79d0029426aa Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>