[cmake-developers] CMake "find_package" command on a package that is not installed is unexpectedly successful

Brad King brad.king at kitware.com
Tue Feb 5 14:46:34 EST 2019


On 2/5/19 2:37 PM, Timothy Wrona wrote:
> Can anyone explain to me how "find_package" is able to find the Eigen libraries
> even though they are just pasted into some arbitrary location that I never told
> the example project about?

Eigen uses the CMake package registry feature:

  https://bitbucket.org/eigen/eigen/src/a3be57987f/CMakeLists.txt?at=default&fileviewer=file-view-default#CMakeLists.txt-602:604

See docs here:

  https://cmake.org/cmake/help/v3.13/manual/cmake-packages.7.html#package-registry

and step 6 of the find_package search procedure:

  https://cmake.org/cmake/help/v3.13/command/find_package.html#search-procedure

-Brad


More information about the cmake-developers mailing list