

#Cmake clean code
Sub-directory inherit properties set in the parent directory, reducing theĪmount of code duplication. Is nice about CMake is that CMakeLists.txt files in a The source for catkin_make is located at catkin_make.CMake is controlled by writing instructions in CMakeLists.txt files.Įach directory in your project should have a CMakeLists.txt file.
#Cmake clean install
Note that this applies for all cases where you need to install your packages to a location where you normally don't have read and write permissions. The installation should proceed without any further issues. The final step is to call catkin_make with the arguments from above. You don't need anything else since the way catkin_make install works is to simply copy the files from your source location to the location where you want to install your ROS packages. This will make catkin_make visible to the superuser. Now that you have superuser privileges all you have to do is source the setup.bash located in your non-super user's catkin workspace or the one located in /opt/ros//setup.bash: All you have to do is change the current user (marked as indicating a user with not superuser privileges and the one you normally use for developing ROS software): That is why option two seems the most straight forward way to go. The third option might pose some issues for new ROS users who are not used to handling multiple workspaces, which require combining several setup.bash files. So under normal circumstances we have only the second and third option from the list above.

Also working as a superuser is often something that people generally avoid to do (security reasons). The first option is not recommended since ROS doesn't usually require superuser privileges when you do development. Install the packages to a location where you have the required permissions (read and write).Install ROS (at least the minimal installation) for root (not recommended!) There are three possible ways of solving this: Usually as a normal user you don't have permissions to write to /opt hence you need superuser privileges. Important note: When installing to /opt/ros/ (where refers to the version ROS you have, e.g indigo, kinetic.) you will probably face an issue with the permissions. $ catkin_make -DCMAKE_INSTALL_PREFIX=/opt/ros/ install You can change the location to which packages are installed by passing -DCMAKE_INSTALL_PREFIX=. It contains setup.*sh files which can be sourced, allowing you to utilize the packages your built. This is a FHS compliant installation of all of the packages in your catkin workspace. Now there should be a third folder in the root of your workspace: install. Which would be equivalent to calling make like this: For example, you can invoke the install target like this: You can pass any arguments to catkin_make that you would normally pass to make and cmake.
#Cmake clean plus
The build folder is where cmake and make are invoked, and the devel folder contains any generated files and targets, plus setup.*sh files so that you can use it like it is installed.
