Ask Your Question
1

How to catkin_make_isolated a non-catkin package when CMakeLists.txt not in pkg root

asked 2018-07-24 06:00:47 -0500

shardator gravatar image

updated 2018-07-24 06:02:46 -0500

Hi,

We'd like to make our projects self-contained, so we are adding all possible (external) packages to our GIT repo as submodule, and build our project with catkin_make_isolated. This works with Ceres, Google Cartographer, etc., but does not seem to be working with some other module.

I added it as submodule, but the problem (apart from the missing package.xml, which I created) is that the CMakeLists.txt file is in a cmake/ directory, not in the package root. It looks like catkin_make_isolated fails to find the cmake/CMakeLists.txt file.

Moving or symlinking does not work, as the file uses other files in the cmake/ directory.

Is there a way to force catkin to look for CMakeLists.txt in cmake/?

Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-07-24 11:28:56 -0500

mbarulic gravatar image

While knowing more specifics about which package you're looking at would help give a more confident answer, I think the following may help:

  1. Add a new top-level CMakeLists.txt file in the location catkin is expecting
  2. Fill it with the basics (cmake_mininum_required(..), project(...), etc.)
  3. Use add_subdirectory(cmake) to tell catkin to look in the 'cmake' directory for another CMakeLists.txt file
edit flag offensive delete link more

Comments

Hi! Thank you, this solved the problem! I tried add_subdirectory before, but I did something wrong. Now everything is fine. (The package was google protocol buffer, protobuf3.)

shardator gravatar image shardator  ( 2018-07-24 17:15:43 -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: 2018-07-24 06:00:47 -0500

Seen: 217 times

Last updated: Jul 24 '18