ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Copying files in devel folder - CMakeLists.txt

asked 2014-07-02 15:58:54 -0600

gariepya gravatar image

Hi

My application requires a configuration file and a resource folder placed in the same directory as the executable. Those are located at : ~/workspace/src/project/cfg/. I want to copy this file and this directory at ~/workspace/devel/lib/project/, where my executable is located.

What can I add to my CMakeLists.txt to achieve that? I have tried using ${CATKIN_PACKAGE_BIN_DESTINATION}, but it creates a lib subdirectory in build.

Thank you

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2014-07-02 16:21:43 -0600

Dirk Thomas gravatar image

updated 2014-07-03 01:16:41 -0600

The CATKIN_PACKAGE_BIN_DESTINATION variable only contains a relative path. You need to additionally use CATKIN_DEVEL_PREFIX. So combined you want to install to:

"${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_BIN_DESTINATION}`

which will be:

<develspace>/lib/${PROJECT_NAME}
edit flag offensive delete link more

Comments

`BIN_DESTINATION` twice?

gvdhoorn gravatar image gvdhoorn  ( 2014-07-02 23:50:15 -0600 )edit

Sorry, that was a copy-n-paste error - I updated the answer.

Dirk Thomas gravatar image Dirk Thomas  ( 2014-07-03 01:17:27 -0600 )edit

Thank you! I miss it in the documentation for some reason,..

gariepya gravatar image gariepya  ( 2014-07-03 08:04:55 -0600 )edit

I get something weird with "${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_BIN_DESTINATION}" I am getting this:

<develspace>/.private/<packagename>/lib/<packagename>

I really would like to get: <develspace>/.private/<packagename>/lib/

Pablo Iñigo Blasco gravatar image Pablo Iñigo Blasco  ( 2019-04-11 11:26:51 -0600 )edit

Instead of commenting on a 5 years old answered question please ask your own question with enough information.

Dirk Thomas gravatar image Dirk Thomas  ( 2019-04-11 11:32:39 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-07-02 15:58:54 -0600

Seen: 2,551 times

Last updated: Jul 03 '14