diff options
author | Gael Guennebaud <g.gael@free.fr> | 2017-11-15 20:45:09 +0000 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2017-11-15 20:45:09 +0000 |
commit | 7f42a93349c7ed175fda5a684f603dfdcf6724e8 (patch) | |
tree | d654655830d0d46948752b06932c15b45f710efe /cmake | |
parent | 7cc503f9f57f6d3524115b222b62e584a04ff3ef (diff) |
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 <acvaucher@gmail.com>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/FindEigen3.cmake | 9 |
1 files changed, 9 insertions, 0 deletions
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() |