CMakeList question on overrides

asked 2017-10-10 23:07:12 -0500

rnunziata gravatar image

updated 2017-10-10 23:17:37 -0500

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}

edit retag flag offensive close merge delete

Comments

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 ;)

TTDM gravatar image TTDM  ( 2017-10-12 07:27:49 -0500 )edit