From 5b07f14a4ff6b08887473b1b583ee2f71dec6f76 Mon Sep 17 00:00:00 2001 From: Martin Reboredo Date: Thu, 11 Nov 2021 14:39:53 -0300 Subject: CMake build: generate pkgconfig for public modules 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 --- cmake/QtBuild.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'cmake/QtBuild.cmake') diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 2cd06c435d..d293c0d083 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -524,6 +524,7 @@ include(QtModuleHelpers) include(QtNoLinkTargetHelpers) include(QtPluginHelpers) include(QtPrecompiledHeadersHelpers) +include(QtPkgConfigHelpers) include(QtPriHelpers) include(QtPrlHelpers) include(QtQmakeHelpers) -- cgit v1.2.3