Go to file
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
bin syncqt: Do not clean header directory before "-minimal" run 2018-11-22 14:16:53 +00:00
cmake Write find_dependency() calls in Qt Module config files 2019-05-02 07:30:42 +00:00
config.tests Merge commit 'dev' into 'wip/cmake-merge' 2019-04-16 16:32:08 +02:00
dist Merge remote-tracking branch 'origin/5.12' into 5.13 2019-03-20 14:09:30 +01:00
doc Merge commit 'dev' into 'wip/cmake-merge' 2019-04-16 16:32:08 +02:00
examples Write find_dependency() calls in Qt Module config files 2019-05-02 07:30:42 +00:00
lib Purge all fonts 2015-08-18 19:59:14 +00:00
mkspecs Merge remote-tracking branch 'origin/5.13' into dev 2019-04-10 08:16:20 +02:00
qmake Export tool config and target files for each relevant module 2019-05-02 07:30:30 +00:00
src Write find_dependency() calls in Qt Module config files 2019-05-02 07:30:42 +00:00
tests CMake: Add tests/auto/corelib/io/qabstractfileengine 2019-04-29 12:02:22 +00:00
util Write find_dependency() calls in Qt Module config files 2019-05-02 07:30:42 +00:00
.gitattributes Update the git-archive export options 2012-09-07 15:39:31 +02:00
.gitignore Merge commit 'dev' into 'wip/cmake-merge' 2019-04-16 16:32:08 +02:00
.qmake.conf Bump version 2019-03-22 05:35:40 +00:00
.tag Update the git-archive export options 2012-09-07 15:39:31 +02:00
CMakeLists.txt Export tool config and target files for each relevant module 2019-05-02 07:30:30 +00:00
config_help.txt qtlite: Add a new option -no-pcre 2019-02-22 14:04:54 +00:00
configure configure: Treat win32-clang-g++ the same as win32-g++ 2018-10-10 04:10:40 +00:00
configure.bat Configure: simplify logic 2019-03-14 12:13:58 +00:00
configure.cmake Write find_dependency() calls in Qt Module config files 2019-05-02 07:30:42 +00:00
configure.json Merge commit 'dev' into 'wip/cmake-merge' 2019-04-16 16:32:08 +02:00
configure.pri Merge remote-tracking branch 'origin/5.12' into 5.13 2019-03-26 08:27:02 +01:00
header.BSD Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.COMM Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.FDL Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.GPL Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.GPL-EXCEPT Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.LGPL Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.LGPL3 Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.LGPL3-COMM Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.LGPL-NOGPL2 Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.LGPL-ONLY Use placeholder for year in header.* files 2018-04-16 11:02:22 +00:00
header.MIT qsimd: add support for new x86 CPU features 2018-05-05 06:20:07 +00:00
INSTALL INSTALL: Remove outdated reference to Windows CE 2019-02-13 13:01:57 +00:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.GPL2 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3-EXCEPT Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.LGPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.LGPLv3 Remove LICENSE.GPLv3, LICENSE.LGPLv21, LGPL_EXCEPTION.txt 2018-04-16 11:02:14 +00:00
LICENSE.QT-LICENSE-AGREEMENT-4.0 Replace commercial preview license with Qt License Agreement 4.0 2018-06-21 11:39:15 +00:00
qtbase.pro nuke configure -host-option 2016-12-13 18:55:59 +00:00
sync.profile platformsupport/input: add xkbcommon utilities lib 2019-03-01 14:31:28 +00:00