FindEigen3.cmake 1.43 KB
Newer Older
David Bommes's avatar
David Bommes committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# - Find Eigen3
# Find the native GMM headers and libraries.
#
#  Eigen3_INCLUDE_DIR -  where to find <Eigen/Dense>, etc.
#  Eigen3_FOUND        - True if Eigen3 found.

IF (Eigen3_INCLUDE_DIR)
  # Already in cache, be silent
  SET(Eigen3_FIND_QUIETLY TRUE)
ENDIF (Eigen3_INCLUDE_DIR)

GET_FILENAME_COMPONENT(module_file_path ${CMAKE_CURRENT_LIST_FILE} PATH )

# Look for the header file.
FIND_PATH(Eigen3_INCLUDE_DIR NAMES Eigen/Dense 
                             PATHS /usr/include/eigen3
                                   /usr/local/include
                                   "c:\\libs\\eigen3\\include"
19 20
								   "c:\\libs\\eigen\\include"
				                   ${PROJECT_SOURCE_DIR}/MacOS/Libs/eigen3/include
21 22
                                   ../../External/include
                                   ${module_file_path}/../../../External/include)
David Bommes's avatar
David Bommes committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43


# Copy the results to the output variables.
IF(Eigen3_INCLUDE_DIR )
  SET(Eigen3_FOUND 1)
  SET(Eigen3_INCLUDE_DIR ${Eigen3_INCLUDE_DIR})
ELSE(Eigen3_INCLUDE_DIR )
  SET(Eigen3_FOUND 0)
  SET(Eigen3_INCLUDE_DIR)
ENDIF(Eigen3_INCLUDE_DIR )

# Report the results.
IF(NOT Eigen3_FOUND)
  SET(Eigen3_DIR_MESSAGE
    "Eigen3 was not found. Make sure Eigen3_INCLUDE_DIR is set to the directories containing the include and lib files for Eigen3. .")
ELSE (NOT Eigen3_FOUND)
  IF(NOT Eigen3_FIND_QUIETLY)
    MESSAGE(STATUS "Looking for Eigen3 - found")
  ENDIF(NOT Eigen3_FIND_QUIETLY)
ENDIF(NOT Eigen3_FOUND)