Skip to content

Wrong libdir in pkg-config .pc files if CMAKE_INSTALL_LIBDIR is absolute #489

@akien-mga

Description

@akien-mga

If you pass an absolute path to CMAKE_INSTALL_LIBDIR (which is supported by CMake and used among other things by RPM distro packager's cmake macros), you can end up with:

$ cat /usr/lib64/pkgconfig/vulkan.pc
prefix=/usr
exec_prefix=/usr
libdir=${exec_prefix}//usr/lib64
includedir=${prefix}/include

Name: Vulkan-Loader
Description: Vulkan Loader
Version: 1.2.154
Libs: -L${libdir} -lvulkan
Libs.private:  -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
Cflags: -I${includedir}

Note that the Libs.private are also bogus, I'll open another issue for that.

I made a PR to solve this in the past, but it couldn't be merged: #214

That's a pretty common issue so I'm sure there's a proper way to do this with CMake... but there's so many ways to do things with CMake that I'm not so inclined to give it another go myself, so I open an issue instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions