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

Catkin install destination

asked 2020-01-19 11:39:04 -0500

prex gravatar image

updated 2020-01-19 11:40:23 -0500

I'm trying to figure out where my files should be installed by the Cmake install() macro (ROS melodic on Ubuntu 18.04). I found this list of catkin environment variables which are relative to the CMAKE_INSTALL_PREFIX. But how can I actually find the path of the install destinations to check if my files were successfully installed? I tried echo $CATKIN_GLOBAL_INCLUDE_DESTINATION or echo $CMAKE_INSTALL_PREFIX which both output an empty line.

I'm also wondering why I never had an install folder in my workspace yet. Should I change my CMAKE_INSTALL_PREFIX path when using ROS? I never read anything about this before. Some packages are even missing the install macro completely and work fine anyway.

edit retag flag offensive close merge delete


Running catkin_make install should create an install folder in your workspace. If our packages contain install directives.

A good explanation can be found here:

knxa gravatar image knxa  ( 2020-01-19 12:13:14 -0500 )edit

For which variables you should use, and how, you'll want to take a look at the catkin 0.7.20 documentation » How to do common tasks » Package format 2 (recommended). Specifically the Building and installing targets section.

There are conventions for where files should end up and they are documented in those articles.

gvdhoorn gravatar image gvdhoorn  ( 2020-01-19 12:25:40 -0500 )edit

Do I also need to source the install space?

prex gravatar image prex  ( 2020-01-19 14:55:43 -0500 )edit

Do I also need to source the install space?


Dirk Thomas gravatar image Dirk Thomas  ( 2020-01-21 18:02:01 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2020-01-19 14:31:29 -0500

prex gravatar image

updated 2020-01-19 14:46:49 -0500

I realized that I needed to set catkin config --install for the catkin_tools first, so that the install folder is created (already with the correct prefix path). Together with the two links above, this explains why I never found these files.

But packages also run fine from the devel space. In this case they can for example include header files from source space, which confused me a little bit at the beginning, because they were not present in devel.

I am still happy to hear how to check the path of these environment variables.

edit flag offensive delete link more


The variables you mentioned (e.g. CMAKE_INSTALL_PREFIX) are CMake variables - not environment variables in your shell. They are simply not available after the build has finished. The install prefix is by default the install subdirectory of your workspace.

Dirk Thomas gravatar image Dirk Thomas  ( 2020-01-21 18:05:03 -0500 )edit

Question Tools

1 follower


Asked: 2020-01-19 11:39:04 -0500

Seen: 1,037 times

Last updated: Jan 19 '20