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

Add CMake components to neatly install individual libraries #22

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

delta512
Copy link
Contributor

Dear maintainers,
as you might guess from the title, I've just specified the COMPONENT attribute for each install() directive.
These are qrcodegen for the C library and qrcodegencpp for the C++ implementation.

This enables installing only one of the two library flavors with commands in the form:
cmake --install <build_dir> [--prefix <install_dir>] --component <component>

My use case for this is to produce split packages in a more elegant way. As an example, split packages for Arch Linux can be created with both libraries sharing a common build and test process, then they can be packaged separately without all those clean-up instructions (as seen in the qrcodegen-cmake AUR package).

Thanks for your time, hope you'll find it useful as well.

Cheers!

@xvitaly xvitaly requested a review from leha-bot April 30, 2024 06:26
Copy link
Contributor

@leha-bot leha-bot left a comment

Choose a reason for hiding this comment

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

Big thanks for your PR! Looks great for me
One negligible comment: may you update the README for users how to install both libraries with CMake components (like "sudo cmake --install qrcodegen-build --component qrcodegencpp")

Copy link
Member

@xvitaly xvitaly left a comment

Choose a reason for hiding this comment

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

Please squash your commits to a single one and add a sign-off (you can use git commit -s and the Git will handle it automatically).

We need signed-off commits for sending changes to the upstream.

Assign each file to the corresponding CMake component, one for the
C library and another one for the C++ version.

This enables install commands in the form:
`cmake --install <build_dir> [--prefix <install_dir>] --component <component>`

Signed-off-by: Filip Valgimigli <[email protected]>
@delta512
Copy link
Contributor Author

Hi all, glad you appreciated it.

Please squash your commits to a single one and add a sign-off (you can use git commit -s and the Git will handle it automatically).

We need signed-off commits for sending changes to the upstream.

To @xvitaly, I've squashed the fix into the main commit and signed-off as requested, please just check if anything else is missing.

Big thanks for your PR! Looks great for me One negligible comment: may you update the README for users how to install both libraries with CMake components (like "sudo cmake --install qrcodegen-build --component qrcodegencpp")

To @leha-bot, I've added the instructions concerning the CMake components, let me know if it blends well into the rest.

Thanks to both,
Cheers!

Copy link
Member

@xvitaly xvitaly left a comment

Choose a reason for hiding this comment

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

LGTM now. Thanks for your contribution.

@xvitaly xvitaly merged commit e9ba268 into EasyCoding:master Apr 30, 2024
2 checks passed
@delta512 delta512 deleted the components branch April 30, 2024 20:04
@delta512
Copy link
Contributor Author

My pleasure!

Thank you all for reacting so quickly, I can keep pulling from upstream in my PKGBUILD. 😎

Hasta la vista!

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.

3 participants