Sophus icon indicating copy to clipboard operation
Sophus copied to clipboard

Missing argument for importing eigen in cmake

Open anuppari opened this issue 3 years ago • 1 comments

The eigen library suggests importing eigen with the NO_MODULE argument in find_package, i.e., this line should be

find_package(Eigen3 3.3.0 REQUIRED NO_MODULE)

This enables consumers to choose the version of eigen via the Eigen3_DIR variable.

This fix may also address some of the issues in #187

anuppari avatar Jan 23 '21 02:01 anuppari

I don't think this is a good idea. Not providing NO_MODULE allows most flexibility by package users. They can then decide to provide a find module or use config mode.

Cmake's own recommendation is to prefer basic signature (i.e. not pass NO_MODULE):

Where possible, user code should generally look for packages using the basic signature, since that allows the package to be found with either mode.

Note that users of Sophus can already use the Eigen3_DIR or Eigen3_ROOT cmake variables to customize the Eigen location, even w/o NO_MODULE, e.g. by ensuring that cmake doesn't find a custom find module for Eigen so it uses config mode, or by passing CMAKE_FIND_PACKAGE_PREFER_CONFIG to cmake to make it try config mode first.

NikolausDemmel avatar Apr 19 '22 15:04 NikolausDemmel