From 7f42a93349c7ed175fda5a684f603dfdcf6724e8 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 15 Nov 2017 20:45:09 +0000 Subject: Merged in alainvaucher/eigen/find-module-imported-target (pull request PR-324) In the CMake find module, define the Eigen imported target as when installing with CMake * In the CMake find module, define the Eigen imported target * Add quotes to the imported location, in case there are spaces in the path. Approved-by: Alain Vaucher --- cmake/FindEigen3.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cmake') diff --git a/cmake/FindEigen3.cmake b/cmake/FindEigen3.cmake index 9e9697860..657440ba5 100644 --- a/cmake/FindEigen3.cmake +++ b/cmake/FindEigen3.cmake @@ -10,6 +10,10 @@ # EIGEN3_INCLUDE_DIR - the eigen include directory # EIGEN3_VERSION - eigen version # +# and the following imported target: +# +# Eigen3::Eigen - The header-only Eigen library +# # This module reads hints about search locations from # the following enviroment variables: # @@ -95,3 +99,8 @@ else (EIGEN3_INCLUDE_DIR) endif(EIGEN3_INCLUDE_DIR) +if(EIGEN3_FOUND AND NOT TARGET Eigen3::Eigen) + add_library(Eigen3::Eigen INTERFACE IMPORTED) + set_target_properties(Eigen3::Eigen PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${EIGEN3_INCLUDE_DIR}") +endif() -- cgit v1.2.3