How it works
Eigen provides native CMake support, which makes it easy to set up a C++ project using it. Starting from version 3.3, Eigen ships CMake modules that export the appropriate target, Eigen3::Eigen, which we have used here.
You will have noticed the CONFIG option to the find_package command. This signals to CMake that the package search will not proceed through a FindEigen3.cmake module, but rather through the Eigen3Config.cmake, Eigen3ConfigVersion.cmake, and Eigen3Targets.cmake files provided by the Eigen3 package in the standard location, <installation-prefix>/share/eigen3/cmake. This package location mode is called "Config" mode and is more versatile than the Find<package>.cmake approach we have been using so far. For more information ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access