Skip to content

Support arch-specific lib and cmake folders with catkin_make_isolated #545

Closed
@scpeters

Description

In order to get into debian, they recommend using GNUInstallDirs for installing architecture-dependent libraries. For example, sdformat is in the process of this change, which on my machine causes libraries to be installed to {prefix}/lib/x86_64-linux-gnu/ and the cmake config file to be installed to {prefix}/lib/x86_64-linux-gnu/cmake/sdformat/.

There was some discussion about whether GNUInstallDirs should be used only for packaging debians or for all source installs. In the end, sdformat chose to use it always by default, and I think other packages may do the same. It would greatly enhance the utility of catkin_make_isolated to support this behavior, both for setting the CMAKE_PREFIX_PATH and for setting the LD_LIBRARY_PATH in the setup.sh scripts.

I had been using catkin_make_isolated to build sdformat and gazebo together by manually adding my own package.xml files. gazebo already uses GNUInstallDirs, so I have had to manually edit the LD_LIBRARY_PATH in setup.sh so that the gazebo binaries can find the gazebo libraries. Now with the sdformat change, gazebo cannot find_package sdformat because the cmake folder is in a subfolder of lib rather than share.

One clue for implementing this would be to parse the contents of /etc/ld.so.conf.d/:

$ cat /etc/ld.so.conf.d/x86_64-linux-gnu.conf 
# Multiarch support
/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions