libQuotient icon indicating copy to clipboard operation
libQuotient copied to clipboard

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

Open alexshpilkin opened this issue 2 years ago • 1 comments

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.

alexshpilkin avatar May 17 '22 12:05 alexshpilkin

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.

KitsuneRal avatar May 18 '22 00:05 KitsuneRal