FindEIGEN3.cmake 2.89 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
# - Try to find EIGEN3
# Once done this will define
#  EIGEN3_FOUND         - System has EIGEN3
#  EIGEN3_INCLUDE_DIRS  - The EIGEN3 include directories

if (EIGEN3_INCLUDE_DIR)
  # in cache already
  set(EIGEN3_FOUND TRUE)
  set(EIGEN3_INCLUDE_DIRS "${EIGEN3_INCLUDE_DIR}" )
else (EIGEN3_INCLUDE_DIR)

Jan Möbius's avatar
Jan Möbius committed
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
# Check if the base path is set
if ( NOT CMAKE_WINDOWS_LIBS_DIR )
  # This is the base directory for windows library search used in the finders we shipp.
  set(CMAKE_WINDOWS_LIBS_DIR "c:/libs" CACHE STRING "Default Library search dir on windows." )
endif()

if ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*Win64" )
  SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2012/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*" )
  SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2012/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 12.*Win64" )
  SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2013/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 12.*" )
  SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2013/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*Win64" )
  SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*" )
  SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x32/")
30 31 32 33
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*Win64" )
  SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*" )
  SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x32/")
Jan Möbius's avatar
Jan Möbius committed
34 35 36
endif()


37 38 39 40 41 42 43
find_path( EIGEN3_INCLUDE_DIR 
	   NAMES Eigen/Dense 
           PATHS $ENV{EIGEN_DIR}
                 /usr/include/eigen3
                 /usr/local/include
                 /usr/local/include/eigen3/
                 /opt/local/include/eigen3/
44
                 "${CMAKE_WINDOWS_LIBS_DIR}/general/Eigen-3.3.4"
Jan Möbius's avatar
Jan Möbius committed
45 46 47
                 "${CMAKE_WINDOWS_LIBS_DIR}/general/Eigen-3.2.8"
                 "${CMAKE_WINDOWS_LIBS_DIR}/general/Eigen-3.2.6"
                 "${CMAKE_WINDOWS_LIBS_DIR}/Eigen-3.2.6"
48
                 "${CMAKE_WINDOWS_LIBS_DIR}/Eigen-3.2.6/include"
Jan Möbius's avatar
Jan Möbius committed
49
                 "${CMAKE_WINDOWS_LIBS_DIR}/Eigen-3.2.1"
50 51
                 "${CMAKE_WINDOWS_LIBS_DIR}/Eigen-3.2.1/include"
                 "${CMAKE_WINDOWS_LIBS_DIR}/Eigen-3.2/include"
Jan Möbius's avatar
Jan Möbius committed
52
                 "${CMAKE_WINDOWS_LIBS_DIR}/eigen3/include"
53 54 55 56
                 "${CMAKE_WINDOWS_LIBS_DIR}/eigen/include"
                 ${PROJECT_SOURCE_DIR}/MacOS/Libs/eigen3/include
                 ../../External/include
                 ${module_file_path}/../../../External/include
57 58 59 60 61 62 63 64 65 66 67 68 69 70
          )

set(EIGEN3_INCLUDE_DIRS "${EIGEN3_INCLUDE_DIR}" )


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

mark_as_advanced(EIGEN3_INCLUDE_DIR)

endif(EIGEN3_INCLUDE_DIR)