Skip to content

pkg-config files are broken when CMAKE_INSTALL_{INCLUDE,LIB}DIR is absolute #1400

@alexshpilkin

Description

@alexshpilkin

Describe the bug

As per title: lib/jxl/libjxl.pc.in and lib/threads/libjxl_threads.pc.in have

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

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

Similar to open-source-parsers/jsoncpp#1199. See “Concatenating paths when building pkg-config files” for a discussion of the problem and a suggested fix (I don’t know CMake myself, sorry).

Environment

$ uname -a
Linux localhost 5.15.36 #1-NixOS SMP Wed Apr 27 12:39:02 UTC 2022 x86_64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions