Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: symlink_install: detect and properly symlink versioned libraries #1126

Open
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from

Conversation

xqms
Copy link

@xqms xqms commented Nov 19, 2020

Summary: versioned libraries do not end in ".so" but in ".so.X.Y.Z" and require an additional unversioned symlink to help CMake and the linker find it.

Here is a (quite popular) package that uses versioned libraries: https://github.com/ros-planning/moveit_visual_tools/blob/c166f8ee6412023b4183fc091abe6acbcdba2448/CMakeLists.txt#L57

Currently, the catkin_symlink_install_targets function will not detect the versioned library (in this case libmoveit_visual_tools.so.3.6.0) as a library, copying it to the wrong destination. This PR replaces the simple check for ".so" with a regex that also matches versioned libraries.

Furthermore, versioned libraries require an additional symlink from the unversioned name, otherwise CMake and/or the linker won't find the library. CMake's install(TARGETS) command seems to do that automatically, so we add logic to do that as well.

I didn't find a test case for symlinked installs - if there is one, I'd be happy to add a unit test.

Versioned libraries a) do not end in ".so" but in ".so.X.Y.Z" and b)
require an additional unversioned symlink to help CMake and the linker
find it.
xqms added a commit to xqms/rosfmt that referenced this pull request Dec 3, 2020
I'd like to use proper library versioning, but that doesn't play well
with catkin (see ros/catkin#1126).
@xqms
Copy link
Author

xqms commented May 26, 2021

ping - just hit this bug again with https://github.com/ros-planning/moveit/blob/master/moveit_plugins/moveit_simple_controller_manager/CMakeLists.txt. Anything I can do to make review/merge easier?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant