Commit Graph

9 Commits

Author SHA1 Message Date
Alexandru Croitor
b0772b41c2 CMake: Display found information in some of the Find modules
Change-Id: I5d92f2f1a552888361a2939577c2b0177c62b596
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-26 22:14:48 +02:00
Alexandru Croitor
cf3cef1ef5 CMake: Make more inner find_package calls quiet
Task-number: QTBUG-85276
Change-Id: I8ed84e2f2cdaf90224452a5e5a549791574edc15
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-26 22:14:38 +02:00
Alexandru Croitor
3ffad972c1 CMake: Fix double-conversion usage on macOS
We reported that double-conversion was found on macOS if the std
library supported sscanf_l and _snprintf_l, but that's different
from what qmake does.

This caused not to compile and link the bundled double-conversion
sources, and caused tst_qvariant to fail when doing double conversions
on macOS.

Remove the extra config tests, and make it work like in qmake, so that
the bundled code is used instead. This makes tst_qvariant pass.

Amends 729a73a9cf

Change-Id: I7ddaed5fe6916f483fb3de1962657d7fb6fb40be
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-04 23:21:18 +02:00
Alexandru Croitor
729a73a9cf CMake: Remove old 3rdparty mechanism for double conversion
Change-Id: I2b20d4d9d95a1f7f59bc506046a1ebc20eb305f7
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-10 07:33:07 +01:00
Alexandru Croitor
ace5495870 Fix a few of the Wrap modules to protect against double creation of
targets. This created issues when trying to build standalone examples.

Change-Id: Iaaea2b537793ae25fbf3143cc205574446aa4ad1
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
2019-06-05 12:30:47 +00:00
Alexandru Croitor
774088b677 Build and use double-conversion library shipped by Qt when needed
Some Linux distros might not have a double-conversion library. Because
it is such an essential library for QtCore, compile and use the
the copy of the library bundled with Qt.

Also change library name to be a proper target with double colons,
so that in case the library is not found for some reason, the CMake
configure step would fail, instead of failing at link time.

Task-number: QTBUG-74133
Change-Id: I9f3b4298ae6e952891a7a89541d46878176bf1ce
Fixes: QTBUG-75891
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-22 07:25:41 +00:00
Alexandru Croitor
9b0b464e82 Write find_dependency() calls in Qt Module config files
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>
2019-05-02 07:30:42 +00:00
Mikhail Svetkin
885494c50f CMake: Fix build without double-conversion on macOS
Change-Id: I5102e93141eec95044df44884dcf6ecd1b9e8dd0
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-27 15:28:11 +00:00
Simon Hausmann
e9c45bbddd Begin port of qtbase to CMake
Done-by: Alexandru Croitor <alexandru.croitor@qt.io>
Done-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Done-by: Kevin Funk <kevin.funk@kdab.com>
Done-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Done-by: Simon Hausmann <simon.hausmann@qt.io>
Done-by: Tobias Hunger <tobias.hunger@qt.io>
Done-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Done-by: Volker Krause <volker.krause@kdab.com>
Change-Id: Ida4f8bd190f9a4849a1af7b5b7981337a5df5310
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
2018-11-01 11:48:46 +00:00