code-iai / iai_kinect2

Tools for using the Kinect One (Kinect v2) in ROS
Apache License 2.0
879 stars 519 forks source link

How to add -Dfreenect2_DIR=path_to_freenect2/lib/cmake/freenect2 to catkin_make #543

Closed ishuowang closed 3 years ago

ishuowang commented 5 years ago

Hi, I moved the libfreenect2 to ~/Softwares/libfreenect2/ yesterday. Then I get this error:fatal error: libfreenect2/libfreenect2.hpp: No such file or directory compilation terminated.

So, I check your README.md and find that I need add -Dfreenect2_DIR=path_to_freenect2/lib/cmake/freenect2 to catkin_make

But I don't kown how to do that. Can you do me a favour?THX

rickstaa commented 5 years ago

@SethonyWang There are multiple ways to do this. The easiest way is to supply it as a catkin build argument:

catkin build -j4 -DCMAKE_BUILD_TYPE=Release -Dfreenect2_DIR="$HOME/freenect2/lib/cmake/freenect2"

You can also use the catkin config tool:

catkin config --extend /opt/ros/${ROS_DISTRO} --cmake-args -DCMAKE_BUILD_TYPE=Release -Dfreenect2_DIR="$HOME/freenect2/lib/cmake