Ask Your Question
1

Copying files in devel folder - CMakeLists.txt

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

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 -0500

Dirk Thomas gravatar image

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

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 imagegvdhoorn ( 2014-07-02 23:50:15 -0500 )edit

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

Dirk Thomas gravatar imageDirk Thomas ( 2014-07-03 01:17:27 -0500 )edit

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

gariepya gravatar imagegariepya ( 2014-07-03 08:04:55 -0500 )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 imagePablo Iñigo Blasco ( 2019-04-11 11:26:51 -0500 )edit

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

Dirk Thomas gravatar imageDirk Thomas ( 2019-04-11 11:32:39 -0500 )edit

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: 2014-07-02 15:58:54 -0500

Seen: 1,188 times

Last updated: Jul 03 '14