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 pkg-config support #319

Merged
merged 1 commit into from
Dec 14, 2023
Merged

Add pkg-config support #319

merged 1 commit into from
Dec 14, 2023

Conversation

tfc
Copy link
Contributor

@tfc tfc commented Dec 2, 2023

This PR adds pkg-config support. For every activated extra header lib, it creates an additional pkg-config file.

This way users can run pkg-config on suffixed packages to find out if that feature exists:

$ pkg-config --list-all
rapidcheck_boost      rapidcheck_boost - boost headers for rapidcheck
rapidcheck_boost_test rapidcheck_boost_test - boost_test headers for rapidcheck
rapidcheck_doctest    rapidcheck_doctest - doctest headers for rapidcheck
rapidcheck            rapidcheck - C++ framework for property based testing inspired by QuickCheck and other similar frameworks
rapidcheck_catch      rapidcheck_catch - catch headers for rapidcheck
rapidcheck_gtest      rapidcheck_gtest - gmock headers for rapidcheck

$ pkg-config --exists rapidcheck_gtest && echo yes
yes

$ pkg-config --cflags rapidcheck_gtest
-I/nix/store/24ywzksid0yihlbbbk2yr0074zm06raa-rapidcheck-unstable-2023-04-16/include

@tfc tfc force-pushed the master branch 2 times, most recently from d89342f to a3a98ca Compare December 3, 2023 17:18
@Ericson2314
Copy link

@emil-e it would be good to merge this because we want to use it in Nixpkgs and for Nix.

@emil-e emil-e merged commit ff6af6f into emil-e:master Dec 14, 2023
1 check passed
@Ericson2314
Copy link

Thanks!

set(PKG_CONFIG_VERSION)
set(PKG_CONFIG_LIBDIR "\${prefix}/lib")
set(PKG_CONFIG_INCLUDEDIR "\${prefix}/include")
set(PKG_CONFIG_LIBS)
Copy link

Choose a reason for hiding this comment

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

Is PKG_CONFIG_LIBS intentionally empty?

Copy link

@Ericson2314 Ericson2314 Jan 11, 2024

Choose a reason for hiding this comment

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

Yes I think so, otherwise it won't be replaced or will be a warning/error.

Copy link

Choose a reason for hiding this comment

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

I'm not sure this is correct. rapidcheck ships a librapidcheck.so file which doesn't get picked up with --libs because this is empty

Choose a reason for hiding this comment

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

I think the correct value for PKG_CONFIG_LIBS should be "-L\${libdir} -lrapidcheck"

Choose a reason for hiding this comment

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

Oh nevermind that's not correct. @octurion is right. Sorry!

Copy link

Choose a reason for hiding this comment

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

#326 now intends to apply @octurion's suggestion.

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

Successfully merging this pull request may close these issues.

7 participants