Ask Your Question
0

what does catkin_make do during package building

asked 2017-02-03 05:37:27 -0500

sam26 gravatar image

After creating a package in source folder of catkin workspace , I built the package using catkin_make . I noticed few folders have generated w.r.t the package in devel and build folders of workspace . I couldn't comprehend them . Could someone please tell me what happens for the package after invoking catkin_make ? Thanks in advance.

edit retag flag offensive close merge delete

Comments

So to avoid board members pointing you to documentation again, could you please tell us what you have found yourself, how you understood that and what is still unclear? "a few folders [..] I couldn't comprehend them" is rather vague: which folders specifically, and what was unclear about them?

gvdhoorn gravatar image gvdhoorn  ( 2017-02-03 05:44:12 -0500 )edit

build has got a folder with the package's name in which there is a CMakefiles folder and a installspace folder which has a .pc file by the package's name.

devel space has got a share folder in which there is a CMake folder with .cmake files and the install and src folders are untouched .

sam26 gravatar image sam26  ( 2017-02-03 05:51:18 -0500 )edit

So what do these folders and files mean and why are they only affecting the build and devel spaces ?

sam26 gravatar image sam26  ( 2017-02-03 05:51:53 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-02-03 06:23:16 -0500

gvdhoorn gravatar image

updated 2017-02-03 10:06:31 -0500

I think this is all explained in wiki/catkin/workspaces.

[..] build has got a folder with the package's name in which there is a CMakefiles folder [..]

From the wiki (emphasis mine):

1.2 Build Space

The build space is where CMake is invoked to build the catkin packages in the source space. CMake and catkin keep their cache information and other intermediate files here.

So the files you found under build/$pkg_name are the files that CMake (and to a certain extend Catkin) generate during what CMake calls the configure phase (random link to a page explaining this, I couldn't find something on the CMake site. Refer to 5.2.1 - The CMake Process - The Configure Step). Examples are things like CMakeCache.txt and friends. These are all placed in separate directories, as mixing them wouldn't work.

[..] and a installspace folder which has a .pc file by the package's name.

From the wiki:

1.3 Development (Devel) Space

The development space (or devel space) is where built targets are placed prior to being installed. The way targets are organized in the devel space is the same as their layout when they are installed.

So the devel and the install space have their files and directories layed out in similar ways, and they only contain the results of the build. For the devel space that is limited to things that were generated and compiled (ie: shared libraries and binaries) for the install space that includes everything that was included in an install(..) statement in the CMakeLists.txt (and some additional things like msg headers, but they have install(..) targets automagically added).

The .pc files you specifically mention are pkg-config files. They are generated by the catkin_package(..) statement in your CMakeLists.txt and include information needed by packages to successfully use and link to other packages.

[..] devel space has got a share folder in which there is a CMake folder with .cmake files [..]

Those .cmake files are CMake config files. They have a similar function as the .pc files and were also generated by catkin_package(..).

[..] and the install and src folders are untouched .

I'm not sure I understand this last bit.


Finally, you might want to read A Gentle Introduction to Catkin by @jbohren. Based on your previous questions I think you'll find it enlightening.

edit flag offensive delete link more

Comments

Thank you very much ! Brilliant explanation :)

sam26 gravatar image sam26  ( 2017-02-03 08:25:26 -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

3 followers

Stats

Asked: 2017-02-03 05:37:27 -0500

Seen: 1,451 times

Last updated: Feb 03 '17