Bug 481954 - KWidgetsAddons fails to build at configure step with -DBUILD_SHARED_LIBS=OFF
Summary: KWidgetsAddons fails to build at configure step with -DBUILD_SHARED_LIBS=OFF
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kwidgetsaddons
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 6.0.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Christoph Feck
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-02-28 19:32 UTC by equeim
Modified: 2025-02-10 18:55 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Possible fix for KWidgetsAddons (525 bytes, patch)
2024-07-28 19:33 UTC, equeim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description equeim 2024-02-28 19:32:27 UTC
SUMMARY
When passing -DBUILD_SHARED_LIBS=OFF argument to CMake at configuration step, CMake fails with following error:

CMake Error: install(EXPORT "KF6WidgetsAddonsTargets" ...) includes target "KF6WidgetsAddons" which requires target "KF6WidgetsAddons_resources_1" that is not in any export set.

STEPS TO REPRODUCE
1. Try to build KWidgetsAddons with -DBUILD_SHARED_LIBS=OFF

OBSERVED RESULT
CMake configuration fails.

EXPECTED RESULT
CMake configuration succeeds.

SOFTWARE/OS VERSIONS
Linux: Fedora 39
KDE Frameworks Version: 6.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION
It looks like the issue is triggered by qt_add_resources call: https://invent.kde.org/frameworks/kwidgetsaddons/-/blob/v6.0.0/src/CMakeLists.txt?ref_type=tags#L324

So it could be Qt bug.
Comment 1 equeim 2024-07-28 19:33:25 UTC
Created attachment 172075 [details]
Possible fix for KWidgetsAddons

I think I found a way to make it work.
The problem is that when building static library qt_add_resources adds separate targets for resources that need to be installed.
Unfortunately it needs to be done for every use of qt_add_resources, in all libraries.
I attached a patch that seems to fix the issue for KWidgetsAddons.