qt5base-lts/examples
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
..
aggregate
corelib Merge commit 'dev' into 'wip/cmake-merge' 2019-04-16 16:32:08 +02:00
dbus Merge commit 'dev' into 'wip/cmake-merge' 2019-04-16 16:32:08 +02:00
embedded Merge commit 'dev' into 'wip/cmake-merge' 2019-04-16 16:32:08 +02:00
gui Merge commit 'dev' into 'wip/cmake-merge' 2019-04-16 16:32:08 +02:00
network Merge commit 'dev' into 'wip/cmake-merge' 2019-04-16 16:32:08 +02:00
opengl Examples: cleanup foreach usage 2019-02-02 12:49:19 +00:00
qmake Add cmdline feature to qmake 2019-02-18 07:12:14 +00:00
qpa Merge commit 'dev' into 'wip/cmake-merge' 2019-04-16 16:32:08 +02:00
qtconcurrent Merge commit 'dev' into 'wip/cmake-merge' 2019-04-16 16:32:08 +02:00
qtestlib CMake: Add more examples 2019-03-26 13:03:01 +00:00
sql Merge commit 'dev' into 'wip/cmake-merge' 2019-04-16 16:32:08 +02:00
vulkan Fix use of qrand/qsrand in an example 2019-04-01 14:39:53 +00:00
widgets Write find_dependency() calls in Qt Module config files 2019-05-02 07:30:42 +00:00
xml Merge remote-tracking branch 'origin/5.12' into 5.13 2019-02-19 01:00:08 +01:00
CMakeLists.txt CMake: Add widgets examples 2019-03-26 15:25:39 +00:00
examples.pro Doc: Move touch examples around so they get included in docs 2018-09-14 03:56:22 +00:00
README

Qt is supplied with a number of example applications that have been
written to provide developers with examples of the Qt API in use,
highlight good programming practice, and showcase features found in each of
Qt's core technologies.


Documentation for examples can be found in the Examples section
of the Qt documentation.