I am compiling a cmake file[1] that needs a common library[2]. How do you tell cmake where to find FindXXXX.cmake
?
More concretely, cmake runs find_package(Eigen3 REQUIRED)
and gets angry because I haven't sent CMAKE_MODULE_PATH
or CMAKE_PREFIX_PATH
. Given the path/to/FindEigen3.cmake
, how should they be set? I have set both of these variables to the full qualified path.
CMake Error at CMakeLists.txt:298 (find_package):
By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Eigen3", but
CMake did not find one.
Could not find a package configuration file provided by "Eigen3" with any
of the following names:
Eigen3Config.cmake
eigen3-config.cmake
Add the installation prefix of "Eigen3" to CMAKE_PREFIX_PATH or set
"Eigen3_DIR" to a directory containing one of the above files. If "Eigen3"
provides a separate development package or SDK, be sure it has been
installed.
[1] The exact file is at https://github.com/lightvector/KataGo/blob/master/cpp/CMakeLists.txt#L298
[2] The exact library is Eigen3, but I suspect the answer does not depend on this fact.
A minimal reproducible example is:
git clone https://github.com/lightvector/KataGo.git
cd KataGo/cpp
cmake . -DUSE_BACKEND=EIGEN