Skip to content

[feature request] Add pc files in static linkage. #120

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

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

talregev
Copy link

@talregev talregev commented Jul 8, 2025

This pr is a feature request.
I did Initial work to add pc files in static linkage.
I try few things also with aid of chatgpt, but without succeed. I don't have the knowledge yet.
I am working on this on my free time offline. (not on this PR).

This pr is add the framework flags in osx.
While the PR is generating the pc files in static linkage, all the 3rd flags that qt depends on it not there. Need more work to be done.

If someone have any suggestion or note, please write me here on this PR.
If someone want to take the code and continue the work, or doing some collaboration, I happy to help.

Copy link

cla-assistant bot commented Jul 8, 2025

CLA assistant check
All committers have signed the CLA.

@talregev
Copy link
Author

talregev commented Jul 8, 2025

I understand more of the problem, and suggest a design for future task if it will be accepted here.
Currently qt generate the pc file in the generation phase using file(GENERATE) function. This function is limit in evaluate nested genex values, that why qt skip the nested genex values.
The problem with cmake, that genex can evaluate only in the generation phase, not in the configuration phase.
The functions export(TARGETS ...) and install(EXPORT ...) are fully evaluate. The export(TARGETS ...) is during the generation phase, but cannot create custom file, like pc file.

Because of the limitation of cmake, we need to run cmake twice to create pc file with static linkage:
My approach for fully automated pc file with static link flags.
Create on the generation the cmake file with fully evaluated flags with export(TARGETS ...)
With custom target that will run cmake again on the build time, run another cmake script that will read the exported cmake file from the generation phase, and generate the pc file. It will generate on his generation phase, on the build time from the first cmake.

Let me know what do you think about my approach.

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

Successfully merging this pull request may close these issues.

1 participant