Sophus
Sophus copied to clipboard
Missing argument for importing eigen in cmake
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
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.