-
Notifications
You must be signed in to change notification settings - Fork 34
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
FindIgnOGRE2: prefer versioned component libraries #125
FindIgnOGRE2: prefer versioned component libraries #125
Conversation
Both ogre1.9 and ogre2.1 install component libraries named libOgreOverlay. For ogre1.9, an unversioned symbolic link is installed directly into the lib folder, while in our debian libogre-2.1-dev and brew ogre2.1 packages, an unversioned symbolic link is installed in lib/OGRE-2.1. This find module uses find_library to find Ogre component libraries with HINTS pointing to the lib/OGRE-2.1 subfolder, which is helful but limited because the CMAKE_PREFIX_PATH is searched before the HINTS. When building ignition-rendering with homebrew, the CMAKE_PREFIX_PATH may include /usr/local, which causes the libOgreOverlay library from ogre1.9 to be found before the version from ogre2.1. On macOS, the following are in /usr/local/lib: /usr/local/lib/libOgreOverlay.1.9.0.dylib /usr/local/lib/libOgreOverlay.2.1.0.dylib /usr/local/lib/libOgreOverlay.dylib (sym-link to 1.9.0) This causes find_library to prefer a library name with the version appended before the suffix, while still accepting unversioned names if a versioned name is not found. Signed-off-by: Steve Peters <scpeters@openrobotics.org>
As it happens, the problem is reproducible in Linux if you build |
the changed code is in a |
here's a yaml workspace file if you want to test with a colcon workspace (remember to set to test on macOS, checkout the following branch and use it would be nice if I could configure a CI job to run these tests, but I don't think we currently have that capability |
I did some tests with the Here's the cmd I used:
My ldd result:
But if I build everything without setting
|
yeah, for Linux I basically confirmed that the bug is reproducible, but I don't have a fix for it. it seems to be unable to find libOgreOverlay in either case when I'll look into this further, but I think there's value in merging this even without fixing Linux |
I think we could first call |
sounds good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes look good to me.
I filed #126 to document the problem on Linux |
Both ogre1.9 and ogre2.1 install component libraries named
libOgreOverlay. For ogre1.9, an unversioned symbolic link is
installed directly into the lib folder, while in our debian
libogre-2.1-dev and brew ogre2.1 packages, an unversioned symbolic
link is installed in lib/OGRE-2.1.
This find module uses find_library to find Ogre component libraries
with HINTS pointing to the lib/OGRE-2.1 subfolder, which is helpful
but limited because the CMAKE_PREFIX_PATH is searched before
the HINTS. When building ignition-rendering with homebrew, the
CMAKE_PREFIX_PATH may include /usr/local, which causes the
libOgreOverlay library from ogre1.9 to be found before the
version from ogre2.1.
On macOS, the following are in /usr/local/lib:
This causes find_library to prefer a library name with the version
appended before the suffix, while still accepting unversioned names
if a versioned name is not found.
I believe this will fix gazebosim/gz-sensors#62