Remove forced CONFIG from find_package(Eigen3)

- Ceres will fail to configure if Eigen3::Eigen target is not found, and
  the minimum required Eigen version specified (3.3) exports Eigen as
  a CMake package and this is reflected in the default Ubuntu 18.04
  packages.
- This permits users to specify their own Eigen3 detection should they
  choose to do so, but they must do so via an imported target.

Change-Id: I5edff117c8001770004f49012ac1ae63b66ec9c1
This commit is contained in:
Alex Stewart
2020-07-26 19:42:16 +01:00
committed by Sameer Agarwal
parent a029fc0f93
commit 7d3ffcb423
3 changed files with 2 additions and 4 deletions
+1 -2
View File
@@ -239,8 +239,7 @@ message("-- Building with C++${CMAKE_CXX_STANDARD}")
# Eigen. # Eigen.
# Eigen delivers Eigen3Config.cmake since v3.3.3 # Eigen delivers Eigen3Config.cmake since v3.3.3
find_package(Eigen3 3.3 CONFIG REQUIRED find_package(Eigen3 3.3 REQUIRED HINTS ${HOMEBREW_INCLUDE_DIR_HINTS})
HINTS ${HOMEBREW_INCLUDE_DIR_HINTS})
if (EIGEN3_FOUND) if (EIGEN3_FOUND)
message("-- Found Eigen version ${EIGEN3_VERSION_STRING}: ${EIGEN3_INCLUDE_DIRS}") message("-- Found Eigen version ${EIGEN3_VERSION_STRING}: ${EIGEN3_INCLUDE_DIRS}")
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)" AND if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)" AND
+1 -1
View File
@@ -191,7 +191,7 @@ set(CERES_EIGEN_VERSION @EIGEN3_VERSION_STRING@)
# Search quietly to control the timing of the error message if not found. The # Search quietly to control the timing of the error message if not found. The
# search should be for an exact match, but for usability reasons do a soft # search should be for an exact match, but for usability reasons do a soft
# match and reject with an explanation below. # match and reject with an explanation below.
find_package(Eigen3 ${CERES_EIGEN_VERSION} CONFIG QUIET) find_package(Eigen3 ${CERES_EIGEN_VERSION} QUIET)
if (EIGEN3_FOUND) if (EIGEN3_FOUND)
if (NOT EIGEN3_VERSION_STRING VERSION_EQUAL CERES_EIGEN_VERSION) if (NOT EIGEN3_VERSION_STRING VERSION_EQUAL CERES_EIGEN_VERSION)
# CMake's VERSION check in FIND_PACKAGE() will accept any version >= the # CMake's VERSION check in FIND_PACKAGE() will accept any version >= the
-1
View File
@@ -444,7 +444,6 @@ dependencies.
#. Try running ``Configure``. It won't work. It'll show a bunch of options. #. Try running ``Configure``. It won't work. It'll show a bunch of options.
You'll need to set: You'll need to set:
#. ``EIGEN_INCLUDE_DIR_HINTS``
#. ``GLOG_INCLUDE_DIR_HINTS`` #. ``GLOG_INCLUDE_DIR_HINTS``
#. ``GLOG_LIBRARY_DIR_HINTS`` #. ``GLOG_LIBRARY_DIR_HINTS``
#. (Optional) ``SUITESPARSE_INCLUDE_DIR_HINTS`` #. (Optional) ``SUITESPARSE_INCLUDE_DIR_HINTS``