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

catkin: generate_messages before building library?

asked 2013-02-15 09:15:37 -0600

TommyP gravatar image

How do I specify in the CMakeList.txt the generation of messages and building of a library. I know how to generate messages only. But when I added a library that used these message the library was compiled before the messages had been generated.

So what is the correct way to do this?

edit retag flag offensive close merge delete

Comments

Regardless of catkin or rosbuild, the recommended practice is to define messages in a separate package. That might or might not help with this problem.

joq gravatar image joq  ( 2013-02-15 10:23:47 -0600 )edit

Yes, I usually do that. But for now I have a package were we have not split it that way. And that would have been a working solution if I had not found a working dependency.

TommyP gravatar image TommyP  ( 2013-02-15 10:33:02 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2013-02-15 10:26:20 -0600

TommyP gravatar image

Found the answer:

add_dependencies(CUASVNodelets lrs_cvimage_gencpp)

solved my problem in the package lrs_cvimage. For me this is not intuitive at all that I have to specify a dependency inside the package. I mean messages could always be generated before compiling.

edit flag offensive delete link more

Comments

catkin relies on native cmake for the build process, and thus add_dependencies is the only way to create a build order (other than wrapping cmake targets, which is against catkin philisophy).

KruseT gravatar image KruseT  ( 2013-02-15 21:20:28 -0600 )edit

Now when I have made this mistake I will probably start to think that it is natural to specify this dependency. It was just a bit annoying that it was hard to find this information. i think this should be in the tutorials since that was what I checked first.

TommyP gravatar image TommyP  ( 2013-02-16 11:06:37 -0600 )edit
KruseT gravatar image KruseT  ( 2013-02-17 06:13:06 -0600 )edit

Question Tools

Stats

Asked: 2013-02-15 09:15:37 -0600

Seen: 2,954 times

Last updated: Feb 15 '13