1# - Find Eigen3 library
2# Find the native Eigen3 includes and library
3# This module defines
4#  EIGEN3_INCLUDE_DIRS, where to find spnav.h, Set when
5#                        EIGEN3_INCLUDE_DIR is found.
6#  EIGEN3_ROOT_DIR, The base directory to search for Eigen3.
7#                    This can also be an environment variable.
8#  EIGEN3_FOUND, If false, do not try to use Eigen3.
9#
10#=============================================================================
11# Copyright 2015 Blender Foundation.
12#
13# Distributed under the OSI-approved BSD 3-Clause License,
14# see accompanying file BSD-3-Clause-license.txt for details.
15#=============================================================================
16
17# If EIGEN3_ROOT_DIR was defined in the environment, use it.
18IF(NOT EIGEN3_ROOT_DIR AND NOT $ENV{EIGEN3_ROOT_DIR} STREQUAL "")
19  SET(EIGEN3_ROOT_DIR $ENV{EIGEN3_ROOT_DIR})
20ENDIF()
21
22SET(_eigen3_SEARCH_DIRS
23  ${EIGEN3_ROOT_DIR}
24)
25
26FIND_PATH(EIGEN3_INCLUDE_DIR
27  NAMES
28    # header has no '.h' suffix
29    Eigen/Eigen
30  HINTS
31    ${_eigen3_SEARCH_DIRS}
32  PATH_SUFFIXES
33    include/eigen3
34)
35
36# handle the QUIETLY and REQUIRED arguments and set EIGEN3_FOUND to TRUE if
37# all listed variables are TRUE
38INCLUDE(FindPackageHandleStandardArgs)
39FIND_PACKAGE_HANDLE_STANDARD_ARGS(Eigen3 DEFAULT_MSG
40    EIGEN3_INCLUDE_DIR)
41
42IF(EIGEN3_FOUND)
43  SET(EIGEN3_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
44ENDIF()
45
46MARK_AS_ADVANCED(
47  EIGEN3_INCLUDE_DIR
48)
49