diff options
author | Stanislaw Halik <sthalik@tehran.lain.pl> | 2020-01-13 15:02:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-13 15:02:44 +0100 |
commit | 50f23dc21fce9d382893ad77dc29fd343ee2134c (patch) | |
tree | 663c0c38fc91b3d021ad8d38ba8ea5b7c0e5b647 /cmake/FindEigen3.cmake | |
parent | fb994308266093382fffecb8a3fd2645ab811117 (diff) | |
parent | 2d709bb4755305342b79a1574c90b2be348b4c4d (diff) |
Merge pull request #1006 from rvt/osx-build-fix
OSX Build fixes
Diffstat (limited to 'cmake/FindEigen3.cmake')
-rw-r--r-- | cmake/FindEigen3.cmake | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/cmake/FindEigen3.cmake b/cmake/FindEigen3.cmake index b43208f9..bbad2298 100644 --- a/cmake/FindEigen3.cmake +++ b/cmake/FindEigen3.cmake @@ -9,6 +9,12 @@ # EIGEN3_FOUND - system has eigen lib with correct version # EIGEN3_INCLUDE_DIR - the eigen include directory # EIGEN3_VERSION - eigen version +# +# This module reads hints about search locations from +# the following enviroment variables: +# +# EIGEN3_ROOT +# EIGEN3_ROOT_DIR # Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org> # Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr> @@ -61,19 +67,29 @@ if (EIGEN3_INCLUDE_DIR) else (EIGEN3_INCLUDE_DIR) - find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library + # search first if an Eigen3Config.cmake is available in the system, + # if successful this would set EIGEN3_INCLUDE_DIR and the rest of + # the script will work as usual + find_package(Eigen3 ${Eigen3_FIND_VERSION} NO_MODULE QUIET) + + if(NOT EIGEN3_INCLUDE_DIR) + find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library + HINTS + ENV EIGEN3_ROOT + ENV EIGEN3_ROOT_DIR PATHS ${CMAKE_INSTALL_PREFIX}/include ${KDE4_INCLUDE_DIR} PATH_SUFFIXES eigen3 eigen ) - + endif(NOT EIGEN3_INCLUDE_DIR) + if(EIGEN3_INCLUDE_DIR) _eigen3_check_version() endif(EIGEN3_INCLUDE_DIR) - #include(FindPackageHandleStandardArgs) - #find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK) + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK) mark_as_advanced(EIGEN3_INCLUDE_DIR) |