diff options
author | Silvio Traversaro <pegua1@gmail.com> | 2016-08-22 22:13:10 +0000 |
---|---|---|
committer | Silvio Traversaro <pegua1@gmail.com> | 2016-08-22 22:13:10 +0000 |
commit | 068ccab9fe0037e7f60cba19d40811131179248b (patch) | |
tree | b7b04a9b1024852cb06d44d0093164e161dd1055 /cmake | |
parent | 5e51a361fee067fb07f41f926721539a0f3d5965 (diff) |
FindEigen3.cmake : search for package only if EIGEN3_INCLUDE_DIR is not already defined
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/FindEigen3.cmake | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/cmake/FindEigen3.cmake b/cmake/FindEigen3.cmake index 3d5b486e3..9e9697860 100644 --- a/cmake/FindEigen3.cmake +++ b/cmake/FindEigen3.cmake @@ -35,11 +35,6 @@ if(NOT Eigen3_FIND_VERSION) set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}") endif(NOT Eigen3_FIND_VERSION) -# 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) - macro(_eigen3_check_version) file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header) @@ -71,16 +66,23 @@ if (EIGEN3_INCLUDE_DIR) set(EIGEN3_FOUND ${EIGEN3_VERSION_OK}) else (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 - ) + + # 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() |