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

Fallback to pkg-config when libpq is not found with CMake. #664

Merged
merged 1 commit into from
Mar 24, 2023

Conversation

skasperski
Copy link
Contributor

Hi,

I think CMake support for libpq is quite new and not available on all systems. It might become obsolete at some point, but for now it might be desirable to offer a fallback for finding libpq with pkg-config, which should be available on many systems.

I am not exactly sure why a policy is required for PostgreSQL, so I moved the new stuff to a separate block.

Best regards,
Sebastian

@jtv
Copy link
Owner

jtv commented Mar 24, 2023

I think CMake support for libpq is quite new and not available on all systems. It might become obsolete at some point, but for now it might be desirable to offer a fallback for finding libpq with pkg-config, which should be available on many systems.

Thank you! Yes, some people experience problems finding PostgreSQL when building with CMake, so it'd be great if this solves it.

I am not exactly sure why a policy is required for PostgreSQL, so I moved the new stuff to a separate block.

Could it be because libpqxx also requires the libpq-fe.h header? On Debian I believe that header is in the postgresql-dev package, not in the libpq-dev package.

@skasperski
Copy link
Contributor Author

Could it be because libpqxx also requires the libpq-fe.h header? On Debian I believe that header is in the postgresql-dev package, not in the libpq-dev package.

I think it should not matter where it is, pkg-config should give the location via include-dir. I used to include the libpq-fe.h and don't recall any issue, at least not on Ubuntu.

@jtv jtv merged commit 9e08f13 into jtv:master Mar 24, 2023
@jtv
Copy link
Owner

jtv commented Mar 24, 2023

And thank you once again.

jtv added a commit that referenced this pull request Mar 24, 2023
Note the changes for #664 & #665 in the appropriate places.
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.

None yet

2 participants