How does LIBRARIES argument in the catkin_package() macro works?

asked 2018-02-26 12:37:10 -0500

auzn gravatar image

I noticed that in my project, if I set the LIBRARIES argument in the catkin_package() macro (even if I set it to ${PROJECT_NAME}), it will break dependencies on messages.

Specifically, let's say that I have a package Foo, and I have a message foo_msg.msg defined inside Foo. Then I have a second package Bar that will publish foo.msg. So in the source files of package Bar, I will need to include foo/foo_msg.h.

Now, in the CMakeList.txt of package Foo, if I set the LIBRARIES argument in the catkin_package() macro, the second package Bar cannot find the auto-generated foo/foo_msg.h. But if I comment out the setting of the LIBRARIES argument, in package Foo, the package Bar can find the proper foo/foo_msg.h.

So I guess my question is what is the purpose of this LIBRARIES argument in the catkin_package() macro? Why it cause my problems, and will skipping this argument cause any issues? I read its documentation but the explanation there is not clear to me.

edit retag flag offensive close merge delete

Comments

2

It would probably be good if you could show us some specific details about your package. Please include the CMakeLists.txt of both your Foo and Bar pkg (remove all boilerplate comments).

Some code from Bar where it includes the header from Foo would also be good.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-26 13:34:13 -0500 )edit