Ask Your Question
0

How can i copy non-binary files into my binaries directory with catkin and cmake?

asked 2016-07-15 09:01:12 -0500

Robert Grönsfeld gravatar image

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?

edit retag flag offensive close merge delete

Comments

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.

gvdhoorn gravatar image gvdhoorn  ( 2016-07-15 10:55:47 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2016-07-15 09:44:19 -0500

Robert Grönsfeld gravatar image

The solution was to replace ${CMAKE_BINARY_DIR} with ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_BIN_DESTINATION}

See also this post.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-07-15 09:01:12 -0500

Seen: 2,231 times

Last updated: Jul 15 '16