ros-perception / laser_geometry

Provides the LaserProjection class for turning laser scan data into point clouds.
BSD 3-Clause "New" or "Revised" License
157 stars 114 forks source link

Handle FindEigen3 module's differing definitions #75

Closed cottsay closed 3 years ago

cottsay commented 3 years ago

The FindEigen3.cmake CMake module sets EIGEN3_INCLUDE_DIR instead of EIGEN3_INCLUDE_DIRS. At the moment, Ubuntu only includes the Eigen3Config.cmake config, while Fedora includes both files. CMake appears to give precedence to the module over the config, so the config never gets processed.

Alternatively, we could pass NO_MODULE to the find_package call, but this would fail on systems that ONLY have the module, though I'm not aware of any such distributions.

A similar change was applied to rviz2.

In the current code, even when Eigen3Config.cmake is used and EIGEN3_INCLUDE_DIR is referenced, a build warning comes out of catkin:

CMake Warning at install/share/catkin/cmake/catkin_package.cmake:166 (message):
  catkin_package() DEPENDS on 'EIGEN3' but neither 'EIGEN3_INCLUDE_DIRS' nor
  'EIGEN3_LIBRARIES' is defined.
Call Stack (most recent call first):
  install/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
  CMakeLists.txt:23 (catkin_package)

This change should also resolve that warning.