# - Try to find Eigen3 lib
#
# This module supports requiring a minimum version, e.g. you can do
#   find_package(Eigen3 3.1.2)
# to require version 3.1.2 or newer of Eigen3.
#
# Once done this will define
#
#  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>
# 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.

if (EIGEN3_INCLUDES)
  # Already in cache, be silent
  set (EIGEN3_FIND_QUIETLY TRUE)
endif (EIGEN3_INCLUDES)

if (EIGEN3_ROOT)
find_path(EIGEN3_INCLUDES
        NAMES Eigen
        PATHS ${EIGEN3_ROOT}
        PATH_SUFFIXES eigen3 eigen
        )
else()
  find_path(EIGEN3_INCLUDES
          NAMES Eigen
          PATHS ${CMAKE_INSTALL_PREFIX}/include
          PATH_SUFFIXES eigen3 eigen
          )
  #find_path (EIGEN3_INCLUDES Eigen)
endif()

# handle the QUIETLY and REQUIRED arguments and set FFTW_FOUND to TRUE if
# all listed variables are TRUE
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (EIGEN3 DEFAULT_MSG EIGEN3_INCLUDES)

mark_as_advanced (EIGEN3_LIBRARIES EIGEN3_INCLUDES)

message("Found Eigen: ${EIGEN3_INCLUDES}")
