From b59eb6f61a487cf1a70306c048bf4ad5d7aab373 Mon Sep 17 00:00:00 2001
From: Gabriel Studer <gabriel.studer@unibas.ch>
Date: Wed, 1 Jul 2015 15:43:53 +0200
Subject: [PATCH] make cmake ready for Eigen3

---
 CMakeLists.txt                |  4 ++--
 cmake_support/FindEigen.cmake | 17 ++++++++---------
 modules/doc/install.rst       |  2 +-
 3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fea7a6b8f..0f8894a33 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -232,7 +232,7 @@ else()
   set (PNG_LIBRARY "")
 endif()
 
-find_package(Eigen 2.0.0 REQUIRED)
+find_package(Eigen 3.2.0 REQUIRED)
 find_package(Python 2.4 REQUIRED)
 
 if(USE_NUMPY)
@@ -299,7 +299,7 @@ endif()
 # basic environment
 include_directories(${Boost_INCLUDE_DIRS} 
                     ${FFTW_INCLUDE_DIRS} 
-                    ${EIGEN2_INCLUDE_DIRS}
+                    ${EIGEN3_INCLUDE_DIRS}
                     ${TIFF_INCLUDE_DIR}
                     ${PNG_INCLUDE_DIRS}
                     ${OPEN_MM_INCLUDE_DIRS}
diff --git a/cmake_support/FindEigen.cmake b/cmake_support/FindEigen.cmake
index fe8937b02..36e33176a 100644
--- a/cmake_support/FindEigen.cmake
+++ b/cmake_support/FindEigen.cmake
@@ -1,20 +1,19 @@
-# - Try to find Eigen2 lib
+# - Try to find Eigen3 lib
 # Once done this will define
 #
-#  EIGEN2_FOUND - system has eigen lib
-#  EIGEN2_INCLUDE_DIRS - the eigen include directories
+#  EIGEN3_FOUND - system has eigen lib
+#  EIGEN3_INCLUDE_DIRS - the eigen include directories
 
-find_path(EIGEN2_INCLUDE_DIR NAMES Eigen/Core
-          PATH_SUFFIXES eigen2
-          PATH_SUFFIXES eigen3
+find_path(EIGEN3_INCLUDE_DIR NAMES Eigen/Core
+PATH_SUFFIXES eigen3
 )
 
-set(EIGEN2_INCLUDE_DIRS ${EIGEN2_INCLUDE_DIR}) 
+set(EIGEN3_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR}) 
 
 include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (EIGEN DEFAULT_MSG EIGEN2_INCLUDE_DIR)
+find_package_handle_standard_args (EIGEN DEFAULT_MSG EIGEN3_INCLUDE_DIR)
 
-mark_as_advanced (EIGEN2_INCLUDE_DIR)
+mark_as_advanced (EIGEN3_INCLUDE_DIR)
 
 
 
diff --git a/modules/doc/install.rst b/modules/doc/install.rst
index a0b36a3f1..526bb1fda 100644
--- a/modules/doc/install.rst
+++ b/modules/doc/install.rst
@@ -28,7 +28,7 @@ Installing the Dependencies
 OpenStructure uses a bunch of OpenSource libraries. If you haven't already installed them, please install them now! Where appropriate the minimally required version is given in parantheses.
 
  * `CMake <http://cmake.org>`_ (2.6.4)
- * `Eigen2 <http://eigen.tuxfamily.org>`_ (2.0.6)
+ * `Eigen3 <http://eigen.tuxfamily.org>`_ (3.2.0)
  * `Boost <http://boost.org>`_ (1.47)
  * `libpng <http://www.libpng.org>`_ 
  * `Python <http://python.org>`_ (2.7)
-- 
GitLab