quotient-im / libQuotient

A Qt library to write cross-platform clients for Matrix
https://quotient-im.github.io/libQuotient/
GNU Lesser General Public License v2.1
135 stars 56 forks source link

pkg-config file is broken when CMAKE_INSTALL_{INCLUDE,LIB}DIR is absolute #551

Open alexshpilkin opened 2 years ago

alexshpilkin commented 2 years ago

Describe the bug

As per title: Quotient.pc.in has

prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@

and so can’t handle absolute paths in CMAKE_INSTALL_{INCLUDE,LIB}DIR. This leads to broken .pc files on NixOS in particular.

Additional context

See “Concatenating paths when building pkg-config files” for a thorough discussion of the problem and a suggested fix, or KDE’s extra-cmake-modules for a simpler approach.

Related to https://github.com/quotient-im/libQuotient/issues/447.

KitsuneRal commented 2 years ago

Thanks for the report. To be honest, I wasn't sure if we should still keep pkg-config files now that CMake is pretty much the only (tested) way to build and link against libQuotient. But I can understand why pkg-config can be easier to start with and make simpler applications.