In Qt6, the installed tools can be in one of two different locations,
depending on whether it is considered a helper or not. This means that
when migrating from Qt5 to Qt6, the pkg-config files no longer reliably
described where to find tools such as moc, uic, and rcc, which
third-party projects need to know about in their build systems.
Add this information in, to match qmake -query and Qt6CoreConfigExtras.cmake
Task-number: QTBUG-105051
Pick-to: 6.2 6.3 6.4
Change-Id: I6692a76e0491a1c5e28982aa5fbe8b8aec8dec56
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
After the update to the CMake based build system the ability to
generate pkgconfig files, like it was with QMake, was lost.
This patch adds pkgconfig generation again via a new internal command
named qt_internal_export_pkg_config_file.
The functionality of this command consists in checking if the target
is internal. Then gets the compile definitions. It performs a search
for dependencies that is somewhat similar to
qt_get_direct_module_dependencies, although it won't recurse down for
more deps. Each dependency is then again, checked if it's internal or
has a public interface. Later these deps get deduplicated and lastly
a pkgconfig file is filled.
The resulting pkgconfig files of many of the Qt6 packages were
validated via invocations of `pkg-config --validate` and
`pkg-config --simulate` commands and later used to build local
projects plus tests that use the pkg-config provided details at
compilation time.
Although it has some limitations, with qt_internal_add_qml_module if
it specifies non-public deps these won't be listed and with non-Qt
requirements, notably in static builds, not being appended to the
PkgConfig file.
Task-number: QTBUG-86080
Change-Id: I0690bb3ca729eec328500f227261db9b7e7628f6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>