CMakeList question on overrides
I want to point to a local directory for Sophus which has se3.h instead of se3.hpp. The path I am specifying does have the correct header.
I set the find_package as follows.
find_package(Sophus REQUIRED NO_SYSTEM_ENVIRONMENT_PATHNO_CMAKE_PATH NO_CMAKE_SYSTEM_PATH NO_DEFAULT_PATH REQUIRED PATHS /home/rjn/catkin_ws/rpg/Sophus)
as you can see I have tried just about every thing allowed to stop cmake from using the system lib. But I still get the error:
In file included from /home/rjn/catkin_ws/src/rpg_ros/rpg_vikit/vikit_common/src/math_utils.cpp:8:0: /home/rjn/catkin_ws/src/rpg_ros/rpg_vikit/vikit_common/include/vikit/math_utils.h:14:24: fatal error: sophus/se3.h: No such file or directory compilation terminated.
The only thing that seems to work is if I hard code the paths in both, this seem like a hack
INCLUDE_DIRECTORIES and TARGET_LINK_LIBRARIES(${PROJECT_NAME}
it looks like what some people (including me) are having/had with OpenCV (for which the same hack also works). I wonder what happen if you clear your workspace ( erase the build an devel directories ) then rebuild it ( without the hack in your cmakefile ). I'd be glad if you can do the test ;)