Re: [eigen] Using Eigen in a project built with CMake

[ Thread Index | Date Index | More Archives ]

You're right. We still have a few pending bugs and PR regarding these kinds of cmake issues, but with now crystal clear agreement on what should be done and how:

I also remember having suggested to add a default Eigen3Config.cmake file at the root of Eigen's source tree so that a "hg clone", "git clone", "wget && tar xzf", etc. is enough to make find_package(Eigen) happy. But I've been told this is bad practice... don't remember why...


On Mon, Mar 11, 2019 at 1:14 PM Bill Greene <w.h.greene@xxxxxxxxx> wrote:
I am trying to create a CMakeLists.txt file for a project that requires Eigen.
A complication is that I would like this CMake build to work in the cases where
Eigen has been installed and when it has simply been unpacked into a directory
tree (this is the way I normally use Eigen).

I have read this doc:

But it appears to me that this approach works only for the installed case because
Eigen3Config.cmake doesn't exist until Eigen is installed.

On the other hand, the un-installed Eigen source tree contains the file FindEigen3.cmake
which can be found by cmake find_package in module mode. But FindEigen3.cmake
isn't copied to the directory tree by the installation process.

As a consequence, my CMakeLists.txt file requires some rather convoluted logic
to support both cases. Am I understanding the current situation correctly?


Mail converted by MHonArc 2.6.19+