Skip to content

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

Description

@alexshpilkin

As per title: cmake/FindCTargets.cmake has

set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
# [snip]
set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")

and so can’t handle absolute paths in CMAKE_INSTALL_{INCLUDE,LIB}DIR. The handling of CMAKE_INSTALL_DOCDIR is more complex but similarly faulty. This leads to broken .pc files on NixOS in particular.

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions