Ask Your Question
2

Difference Between build_depends and find_package components

asked 2013-10-07 09:26:06 -0500

David Lu gravatar image

What is the difference between listing something as a build_depends and listing it in the find_package macro? It seems redundant.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2013-10-07 10:12:13 -0500

joq gravatar image

It mostly is redundant.

Some system dependencies declare non-standard CMake variables, so the CMake interface does need to be spelled out explicitly somewhere, and CMakeLists.txt is a reasonable choice.

Because CMake scripts are not easy for other tools to parse, some information is duplicated in package.xml, where it is more-readily accessible.

edit flag offensive delete link more

Comments

1

So you need to take care of both files simultaneously? Not very efficient...

Hendrik Wiese gravatar imageHendrik Wiese ( 2013-10-07 11:23:25 -0500 )edit

There is also this option: https://github.com/wjwwood/catkin_simple .

joq gravatar imagejoq ( 2013-10-07 12:08:55 -0500 )edit

Was that ever advertised?

David Lu gravatar imageDavid Lu ( 2013-10-07 12:40:06 -0500 )edit
2

FYI, catkin_simple is very unstable, it might change, without warning, in the future (names, api, etc..). I would recommend forking it if you want to use it. It was never advertised because it isn't finished, it doesn't support actions or dynamic_reconfigure and has almost no documentation.

William gravatar imageWilliam ( 2013-10-07 12:57:46 -0500 )edit

There are also cases when you do not want all the dependencies in the CMakeLists.txt if you have dependencies on non-C style packages which provide potentially other resources or tools not able to be integrated into CMake.

tfoote gravatar imagetfoote ( 2013-10-09 17:32:29 -0500 )edit
2

answered 2013-10-07 12:55:07 -0500

Dirk Thomas gravatar image

The package.xml files contain rosdep keys for system dependencies as well as ROS package names. Sadly there is simply no 1-to-1 mapping between those and the find_package() names. So any heuristic (like as it is done in catkin_simple) will never work 100% reliable. That is the reason why the developer has to specify them separately.

edit flag offensive delete link more

Comments

1

That is pretty stupid in my book... Unnecessary redundant redundancy. Who could take care of this flaw?

Hendrik Wiese gravatar imageHendrik Wiese ( 2013-10-07 21:39:48 -0500 )edit

@Hendrik_SeveQ_Wiese `catkin_simple` tries to deal with this, but will fail if a caktin dependency is missing. Basically, for each `build_depend` it calls `find_package(build_depend)` and if it is not found it assumes it is a System package which either doesn't have a CMake Module or doesn't set canonical CMake variables, but it could be that it actually is a catkin package but is not present. There is no way to distinguish between the two cases.

William gravatar imageWilliam ( 2013-10-07 22:30:52 -0500 )edit

How did rosbuild deal with it?

David Lu gravatar imageDavid Lu ( 2013-10-08 05:11:38 -0500 )edit

It just did not. It gets the pkg-config information for all ROS dependencies. But for non-ROS dependencies the developer has to deal with it manually - just because there is no way to do that in a generic way.

Dirk Thomas gravatar imageDirk Thomas ( 2013-10-08 07:08:05 -0500 )edit

@David Lu rosbuild differentiated between rosbuild packages and system packages, <depend> vs <rosdep> tags. But the <depend> tags were not used in packaging, so you had to maintain a second, redundant stack level dependency tree when releasing your code.

William gravatar imageWilliam ( 2013-10-08 07:30:53 -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

2 followers

Stats

Asked: 2013-10-07 09:26:06 -0500

Seen: 492 times

Last updated: Oct 07 '13