- CMake Cookbook
- Radovan Bast Roberto Di Remigio
- 76字
- 2025-04-04 16:17:18
There is more
CMake will look for config modules in a predefined hierarchy of locations. First off is CMAKE_PREFIX_PATH, while <package>_DIR is the next search path. Thus, if Eigen3 was installed in a non-standard location, we can use two alternatives to tell CMake where to look for it:
- By passing the installation prefix for Eigen3 as CMAKE_PREFIX_PATH:
$ cmake -D CMAKE_PREFIX_PATH=<installation-prefix> ..
- By passing the location of the configuration files as Eigen3_DIR:
$ cmake -D Eigen3_DIR=<installation-prefix>/share/eigen3/cmake/