0
$\begingroup$

Rosanswers logo

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.


Originally posted by sam26 on ROS Answers with karma: 231 on 2017-02-03

Post score: 1


Original comments

Comment by gvdhoorn on 2017-02-03:
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?

Comment by sam26 on 2017-02-03:
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 .

Comment by sam26 on 2017-02-03:
So what do these folders and files mean and why are they only affecting the build and devel spaces ?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by gvdhoorn with karma: 86574 on 2017-02-03

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by sam26 on 2017-02-03:
Thank you very much ! Brilliant explanation :)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.