cmake: more strictly enforce finding the included eigen version

This commit is contained in:
Nikolaus Demmel 2019-05-13 21:40:02 +02:00
parent fa91beed17
commit ef8f5e40bd
2 changed files with 6 additions and 7 deletions

View File

@ -167,7 +167,7 @@ set(CMAKE_CXX_FLAGS "${BASALT_CXX_FLAGS} -march=${CXX_MARCH} ${BASALT_PASSED_CXX
set(EIGEN_INCLUDE_DIR_HINTS ${EIGEN_ROOT}) set(EIGEN_INCLUDE_DIR_HINTS ${EIGEN_ROOT})
find_package(Eigen3 3.3.7 REQUIRED) find_package(Eigen3 3.3.7 EXACT REQUIRED MODULE)
include_directories(${EIGEN3_INCLUDE_DIR}) include_directories(${EIGEN3_INCLUDE_DIR})
message(STATUS "Found Eigen headers in: ${EIGEN3_INCLUDE_DIR}") message(STATUS "Found Eigen headers in: ${EIGEN3_INCLUDE_DIR}")
if(NOT EIGEN3_INCLUDE_DIR MATCHES "^${EIGEN_ROOT}") if(NOT EIGEN3_INCLUDE_DIR MATCHES "^${EIGEN_ROOT}")

View File

@ -15,6 +15,10 @@
# Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com> # Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
# Redistribution and use is allowed according to the terms of the 2-clause BSD license. # Redistribution and use is allowed according to the terms of the 2-clause BSD license.
# Adaptations (c) Nikolaus Demmel 2019
# - pass NO_DEFAULT_PATH --> only works when passing exact HINTS
if(NOT Eigen3_FIND_VERSION) if(NOT Eigen3_FIND_VERSION)
if(NOT Eigen3_FIND_VERSION_MAJOR) if(NOT Eigen3_FIND_VERSION_MAJOR)
set(Eigen3_FIND_VERSION_MAJOR 2) set(Eigen3_FIND_VERSION_MAJOR 2)
@ -63,12 +67,7 @@ else (EIGEN3_INCLUDE_DIR)
find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
HINTS ${EIGEN_INCLUDE_DIR_HINTS} HINTS ${EIGEN_INCLUDE_DIR_HINTS}
PATHS NO_DEFAULT_PATH
/usr/local/include
/opt/local/include
${CMAKE_INSTALL_PREFIX}/include
${KDE4_INCLUDE_DIR}
PATH_SUFFIXES eigen3 eigen
) )
if(EIGEN3_INCLUDE_DIR) if(EIGEN3_INCLUDE_DIR)