New user self-registration is disabled due to spam. Please email eigen-core-team @ if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 773 - Provide eigen-config.cmake
Summary: Provide eigen-config.cmake
Status: NEW
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: 3.2
Hardware: All All
: Normal enhancement
Assignee: Nobody
Depends on:
Reported: 2014-03-24 20:32 UTC by Charles Karney
Modified: 2014-03-25 21:15 UTC (History)
2 users (show)

eigen-cmake-config.patch (5.03 KB, patch)
2014-03-24 20:32 UTC, Charles Karney
no flags Details | Diff

Description Charles Karney 2014-03-24 20:32:17 UTC
Created attachment 441 [details]

The attached patch provides support for the cmake command

  find_package (Eigen 3.2)

via eigen-config.cmake and eigen-config-version.cmake.  This will be
able to find Eigen either in the build tree (after "cmake SOURCE_DIR")
or in the install tree (after "make install").  It sets Eigen_FOUND,
Eigen_VERSION, and Eigen_INCLUDE_DIRS.  This is a "config-style" lookup.
If a user has a FindEigen.cmake in his path he might need to specify
Comment 1 Charles Karney 2014-03-25 21:15:00 UTC
The version matching rules implemented in eigen-config-version.cmake are

find_package(Eigen 3) matches 3.* but not 2.* or 4.*
find_package(Eigen 3.0) matches 3.* but not 2.* or 4.*
find_package(Eigen 3.1) matches 3.1.*, 3.2.* but not 3.0.* or 4.*
find_package(Eigen 3.2.1) matches 3.2.1, 3.2.2, 3.3.0 but not 3.2.0 or 4.*

This assumes a version acceptable if the first version number matches
and the version is greater or equal to the requested version.

Perhaps the following rules would match more closely how versioning
works with Eigen

find_package(Eigen 3) matches 3.* only
find_package(Eigen 3.0) matches 3.0.* only
find_package(Eigen 3.2) matches 3.2.* only
find_package(Eigen 3.2.1) matches 3.2.n for n>=1 but not 3.2.0 or 3.3.*

I can easily modify the version checking to implement this.  Let me know.

Note You need to log in before you can comment on or make changes to this bug.