Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: Fix Qt resource files with CMake 3.20 #3750

Merged
merged 1 commit into from
Mar 27, 2021

Conversation

Holzhaus
Copy link
Member

@Holzhaus Holzhaus added this to the 2.3.0 milestone Mar 26, 2021
@Holzhaus Holzhaus requested a review from uklotzde March 26, 2021 23:01
@uklotzde
Copy link
Contributor

Could you provide a short explanation what was wrong and how you fixed it?

@uklotzde
Copy link
Contributor

Ok, the "how" is obvious, by inlining the code.

@Holzhaus
Copy link
Member Author

I suspected somethings was wrong with the QRC file because according to the mixxx logs the resource dir is correct but the Qt Resource System still didn't find any resources.
Since I updated CMake 2 days ago to 3.20, I suspected that this was the root cause.

Before, we added a mixxx-qrc OBJECT target, then added the resulting objects to mixxx and mixxx-test. This is weird and apparently doesn't work with CMake 3.20. Instead, it now just adds the QRC file to the mixxx/mixxx-test target directly using target_sources. More straightforward and it works.

(We can't just add it to mixxx-lib because that would require using the Q_INIT_RESOURCES macro).

Copy link
Contributor

@uklotzde uklotzde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new solution is simpler and easier to understand. Removing the remaining redundancy would require to fix mixxx-lib as the comment suggests. LGTM

@uklotzde
Copy link
Contributor

Thank you for the quick fix!

@uklotzde uklotzde merged commit 0716ff2 into mixxxdj:2.3 Mar 27, 2021
@uklotzde
Copy link
Contributor

Fortunately even Fedora f35/rawhide still uses 3.19.

@Holzhaus
Copy link
Member Author

Thank you for the quick fix!

I had to, otherwise I can't build Mixxx anymore 😜

@jospezial
Copy link

This change also fixed an issue with missing button icons that I had in Gentoo since 2 months with cmake-3.19.x.
Mixxx in fedora rawhide from rpmfusion package also has the missing button icons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants