I have two versions of the Ceres solver installed. One is in /opt/local/lib
and the other is in /usr/local/lib/
and I am using cmake to build an application that uses the latter. In my build
subdirectory the following works fine:
cmake -DCeres_DIR=/usr/local/lib/cmake/Ceres/ ..
I would rather specify the correct path in the CMakeLists.txt
file as described in this post, but the following fails:
find_package(Ceres PATHS /usr/local/lib/cmake/Ceres)
When I do this, cmake complains since it finds the wrong CeresConfig.cmake
file which was built using a different version of Eigen:
CMake Error at /opt/local/lib/cmake/Ceres/CeresConfig.cmake:85 (message):
Failed to find Ceres - Found Eigen dependency, but the version of Eigen
found (3.4.0) does not exactly match the version of Eigen Ceres was
compiled with (3.3.9).
....
Clearly is it using the Ceres installation in /opt/local/lib
not /usr/local/lib
.
Why isn't the PATHS
specification working in this case?