From 5b954096fd8c6c859a4fab8871d9182069a64913 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Mon, 2 Sep 2013 10:01:38 +0200 Subject: [PATCH] Search after new Eigen3 versions in sibling dirs If we have checked out a newer Eigen3 directory in a sibling directory to ours, assume that this is because the system version is obsolete and that we want to use this one instead. --- cmake/Modules/FindEigen3.cmake | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cmake/Modules/FindEigen3.cmake b/cmake/Modules/FindEigen3.cmake index 49fc6c68d..470bb7a49 100644 --- a/cmake/Modules/FindEigen3.cmake +++ b/cmake/Modules/FindEigen3.cmake @@ -99,10 +99,15 @@ if (NOT EIGEN3_INCLUDE_DIR) NO_DEFAULT_PATH ) else (EIGEN3_ROOT) - find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library - PATHS - ${CMAKE_INSTALL_PREFIX}/include - ${KDE4_INCLUDE_DIR} + # assume that if there is a sibling directory to our project which + # is called eigen3, there is a newer version located there, or that + # it may have been checked out next to the build directory + find_path(EIGEN3_INCLUDE_DIR + NAMES signature_of_eigen3_matrix_library + HINTS ${CMAKE_SOURCE_DIR}/../ + ${PROJECT_SOURCE_DIR}/../ + ${CMAKE_INSTALL_PREFIX}/include + ${KDE4_INCLUDE_DIR} PATH_SUFFIXES eigen3 eigen ) endif (EIGEN3_ROOT)