FindIgnOGRE2: prefer versioned component libraries#125
FindIgnOGRE2: prefer versioned component libraries#125scpeters merged 1 commit intogazebosim:ign-cmake2from
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! |
iche033
left a comment
There was a problem hiding this comment.
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