Commit Graph

4 Commits

Author SHA1 Message Date
Cristian Adam
7e10dcb1d4 CMake Build: Add include guards for FindPPS.cmake and FindSlog2.cmake
The CMake configure process fails without include guards for these
two find modules on QNX.

Task-number: QTBUG-83202
Change-Id: I3cc589f98bc3b6b22c401421927ee6dab2663fb7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-19 12:46:10 +02:00
Joerg Bornemann
062b50abff CMake: Namespace all our IMPORTED targets
CMake IMPORTED targets should be namespaced so that CMake knows that
the name refers to a target and not a file.

Use the existing WrapXXX naming scheme where applicable.

Fixes: QTBUG-83773
Change-Id: I5b0b722c811200c56c260c69e76940a625228769
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-29 23:08:32 +02: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
Tobias Hunger
eb2ece3c59 CMake: Add FindSlog2
Add FindSlog2 and use it in src/corelib/configure.cmake.

Change-Id: I7e6a696a49df568a41ed1224228ab608db2dbb0e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-11-06 15:24:55 +00:00