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

Build third party package in build or devel folder.

asked 2015-10-12 11:57:13 -0600

jeffeb3 gravatar image

I have a package that needs to be unzipped, configured, and made. I currently do this inside my source folder. Then I jump through a bunch of hoops to make the dependencies depend on these custom commands.

The current problem I have is that it doesn't clean up. catkin_make clean doesn't delete the built products, and it doesn't delete the unzipped contents.

I could find some way to find the "clean" target, and do something special (like rm -rf unzipped location and build products) but that would probably confuse people because the rest of my build is out of source.

Ideally, I could unzip the source in the build folder somewhere, and then when the user deleted the build and devel folder, the next catkin_make would do a clean unzip and build.

edit retag flag offensive close merge delete


I'm still hoping to find a way to install this into the build folder, but I did find a way to make the catkin_make clean delete the folder:

jeffeb3 gravatar image jeffeb3  ( 2015-10-12 15:08:08 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2015-10-12 12:27:43 -0600

tfoote gravatar image

I would agree that it would be better to do your download and custom logic in the build space. In general it's best practice that a build does not change the source space.

Since you're creating custom commands you should be able to do it in the build space instead of the source space.

edit flag offensive delete link more


Yeah, I'd like to do that. If you agree with my solution, then all I need is the syntax to get to the build folder. Is there a variable for the build folder?

jeffeb3 gravatar image jeffeb3  ( 2015-10-12 12:45:33 -0600 )edit

answered 2015-10-12 12:30:05 -0600

William gravatar image

If it is a CMake project, just put a package.xml file in the source, set the build type to CMake, and then use catkin_make_isolated or catkin build (catkin_make cannot handle a workspace with non-catkin packages in it). For example, you can build gazebo and friends this way:

If it is not a CMake project wrap it in a CMakeLists.txt and make sure the contents are extracted into the build folder. I don't have an example of that off hand, but maybe this link will give you a hint:

edit flag offensive delete link more


It is not a CMake project. It is GeometricTools/WildMagic. Currently, I just unzip it, and call make in a few folders.

jeffeb3 gravatar image jeffeb3  ( 2015-10-12 12:46:46 -0600 )edit

Hmmm. That ExternalProject is an interesting idea. I would need it to be executed from the normal catkin_make process, so mingling the ExternalProject in a catkin CMakeLists.txt could be a very good solution. I'll search for an example.

jeffeb3 gravatar image jeffeb3  ( 2015-10-12 12:53:39 -0600 )edit

Question Tools


Asked: 2015-10-12 11:57:13 -0600

Seen: 508 times

Last updated: Oct 12 '15