How can i copy non-binary files into my binaries directory with catkin and cmake?
Hi, I have a benchmarking executable in my project which pulls data from bagfiles. Now I want to copy the folder with my bagfiles into the directory where my binaries end up, because I have hardcoded paths to them in my code. I already tried to copy the folder with my bagfiles by adding this line to my CMakeLists.txt
:
file(COPY src/benchmarking/bagfiles DESTINATION ${CMAKE_BINARY_DIR})
Unfortunately the variable CMAKE_BINARY_DIR
only contains the absolute path to my source directory. Is there a variable that points to the binaries directory?
Just a suggestion: if you place your bagfiles in a (skeleton) ROS pkg, you could use
rospack find $bag_pkg
to parameterise the location. Could potentially remove the need for hard-coded paths.Alternatively, you could make the paths parameters, and provide the absolute paths at runtime.