From dde11715d357f95370850f5e4eebebcbe7964fb3 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 10 Jun 2020 13:04:13 +0200 Subject: [PATCH] CMake: Temporary workaround for static top-level Qt builds Because find_package usually creates targets in a local scope, qt_generate_prl_file fails to generate a .prl file that has references to generator expressions like "$" which references targets that are not found in that specific scope (e.g Freetype target is present in qtbase scope, but not qtsvg scope). This happens in static top-level Qt builds, and thus fails the configuration. While we try to figure out how to fix this adequatly, don't generate .prl files in such a configuration. Task-number: QTBUG-84874 Change-Id: I69cf0ad1419d21e3676e1374624601f00936c405 Reviewed-by: Joerg Bornemann --- cmake/QtBuild.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index fa977b1016..0a537ab4fa 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -2771,7 +2771,13 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") endfunction() function(qt_finalize_module target) - qt_generate_prl_file(${target}) + # Workaround to allow successful configuration of static top-level Qt builds. + # See QTBUG-84874. + if(QT_SUPERBUILD AND NOT BUILD_SHARED_LIBS) + # Do nothing. + else() + qt_generate_prl_file(${target}) + endif() qt_generate_module_pri_file("${target}" ${ARGN}) endfunction()