libpq is libpqxx on redhat/centos
Chaz6 opened this issue · 7 comments
Chaz6 commented
In order to configure the project with cmake on redhat/centos I had to use the following patch:-
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e520d8e..cb44174 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,7 +6,7 @@ include(GNUInstallDirs)
find_package(PkgConfig REQUIRED)
# Postgres library
-pkg_check_modules(LIBPQ REQUIRED libpq)
+pkg_check_modules(LIBPQ REQUIRED libpqxx)
set(CMAKE_AUTOMOC ON)
dantti commented
libpqxx is a C++ library built on top of libpq, I'm pretty sure RedHat has the right libpq library.
dantti commented
some googling showed that the package is called postgresql-libs
dantti commented
or postgresql-devel
Chaz6 commented
I had to install libpqxx-devel in order to compile. postgresql-devel was not enough.
Chaz6 commented
It might be better to change cmake to use FindPostgreSQL instead of pkg_check_modules() as postgresql-devel does not provide a pkgconfig file on redhat/centos.
$ yum provides /usr/lib64/pkgconfig/libpq.pc
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.trouble-free.net
* centos-sclo-rh: centos.mirror.constant.com
* centos-sclo-sclo: us.mirror.nsec.pt
* elrepo: mirrors.coreix.net
* epel: d2lzkl7pfhq30w.cloudfront.net
* extras: us.mirror.nsec.pt
* updates: mirror.wdc1.us.leaseweb.net
No matches found
Chaz6 commented
See also https://bugzilla.redhat.com/show_bug.cgi?id=977115 ("Please provide pkg-config file for libpq library" // CLOSED CANTFIX)
dantti commented
I'll check FindPostgreSQL, would surely be a nicer solution