Skip to content

Relocatable pkg-config and coin-config files #437

Open
@rickertm

Description

The files Coin.pc used by pkg-config and coin.cfg used by coin-config contain absolute paths which prevent an installation from being moved to another location, even though the latter includes a comment regarding a moveable package. This is also the case for simage, SoQt etc.

The CMake config files are already relocatable, as PACKAGE_PREFIX_DIR is calculated relative to these files via @PACKAGE_INIT@. Something similar could be achieved in Coin.pc by using setting prefix to ${pcfiledir}, see Helping C/C++ Packages be Relocatable. The other variables however would also need to be updated to be relative to prefix.

file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" "${CMAKE_INSTALL_PREFIX}")
string(REGEX REPLACE "/$" "" PACKAGE_RELATIVE_PATH "${PACKAGE_RELATIVE_PATH}")
set(prefix "\${pcfiledir}/${PACKAGE_RELATIVE_PATH}")

coin-config already seems to calculate prefix based on its location, however the other variables are not defined relative to this.

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