gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.19k stars 480 forks source link

Installed gazebo-config.cmake looks for OGRE in the wrong place #2903

Open flabrosse opened 3 years ago

flabrosse commented 3 years ago

First, I'm not sure whose "fault" this is, gazebo's, ogre's or gentoo's. Just trying to figure out.

Versions:

gazebo-11.1.0
ogre-1.9.0-r1

I'm trying to fix some ROS packages for gentoo so that gazebo can be used again in ROS on gentoo. gazebo_ros fails to install because when it uses gazebo's gazebo-config.cmake, it complains of not being able to find FindOGRE.cmake. On gentoo, the file is here:

/usr/lib64/OGRE/cmake/FindOGRE.cmake

This location is not added to the variable CMAKE_MODULE_PATH by gazebo in gazebo-config.cmake. If I add it manually:

set(CMAKE_MODULE_PATH
      "${OGRE_INSTALL_PREFIX}/lib64/OGRE/cmake;${OGRE_INSTALL_PREFIX}/share/OGRE/cmake/modules;${OGRE_INSTALL_PREFIX}/lib/OGRE/cmake;${OGRE_INSTALL_PREFIX}/CMake;${CMAKE_MODULE_PATH}")

then all is fine.

It could be a problem with OGRE or gazebo, or could be fixed in the gentoo packages (of either). I'm happy to submit bugs/create patches but I would appreciate it if someone could tell me which is the correct approach.

Thanks.

j-rivero commented 3 years ago

/usr/lib64/OGRE/cmake/FindOGRE.cmake

Looks like cmake added support for the libX paths in 3.12 that was previously not supported.

Paths with lib/ are enabled if the CMAKE_LIBRARY_ARCHITECTURE variable is set. lib* includes one or more of the values lib64, lib32, libx32 or lib (searched in that order).

If I'm not wrong, we are injecting the values hardcoded so I think it's fine to patch gazebo-config.cmake to accept the paths listed in the cmake 3.12 page if CMAKE_LIBRARY_ARCHITECTURE variable is set.