FindEigen3.cmake 519 Bytes
Newer Older
Steffen Vogel's avatar
Steffen Vogel committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# We first try to find a version inside our local Libraries folder
find_path(EIGEN3_INCLUDE_DIR
	NAMES signature_of_eigen3_matrix_library
	PATHS
		Libraries/eigen
		../Eigen
)

if(NOT EIGEN3_INCLUDE_DIR)
	set(TEMP_PATH ${CMAKE_MODULE_PATH})

	# We temporarily clear the module path to avoid recursion
	set(CMAKE_MODULE_PATH "")
	find_package(Eigen3 REQUIRED)
	set(CMAKE_MODULE_PATH ${TEMP_PATH})
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Eigen3 REQUIRED_VARS EIGEN3_INCLUDE_DIR)