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

Revision history [back]

click to hide/show revision 1
initial version
catkin_make --pkg <my_package_name>

Example:

catkin_make --pkg turtlebot

Multiple Packages:

catkin_make --pkg <package A> <package B>

catkin_make --pkg <my_package_name>

Example:

catkin_make --pkg turtlebot

Multiple Packages:

catkin_make --pkg <package A> <package B>

But as this doesn't work robustly I recommend switching to catkin_tools which allows to build only one package and many more fancy features.

catkin_make --pkg <my_package_name> Example:

catkin_make --pkg turtlebot

Multiple Packages:

catkin_make --pkg <package A> <package B>

But as this doesn't work robustly I recommend switching to catkin_tools which allows to build only one package and many more fancy features.features:

Catkin-Tools: Build Subset of Packages

Build a single package including it's dependencies

catkin_make --only-pkg-with-deps <target_package>

Don't forget to switch back to building all packages when you are done

catkin_make -DCATKIN_WHITELIST_PACKAGES=""


Description

Whitelists only the specified packages and their dependencies by 'setting the CATKIN_WHITELIST_PACKAGES variable. This variable is stored in CMakeCache.txt and will persist between CMake calls unless explicitly cleared. Source: catkin_make --help

But there is an even better way

Using Catkin-Tools:

sudo apt-get install python-catkin-tools

Build specific package

catkin build <target_package>

Build the package from a directory under the package root

catkin build --this


Advantages:

  • you can call catkin build from everywhere
  • always builds packages seperately
  • catkin clean cleans everything (instead of the dangerous rm -rf build devel)
  • more infos

Important notes for catkin_tools:

  • You can't mix catkin build and catkin_make (delete your build/devel/install folders to switch tools)
  • As catkin_build builds all packages seperately there can be problems when passing information between packages via CMake. More Information


Old answer for legacy reasons

catkin_make --pkg <my_package_name>

Example:

catkin_make --pkg turtlebot

Multiple Packages:

catkin_make --pkg <package A> <package B>

But as this doesn't work robustly I recommend switching to catkin_tools which allows to build only one package and many more fancy features:

Catkin-Tools: Build Subset of Packages

Build a single package including it's dependencies

catkin_make --only-pkg-with-deps <target_package>

Don't forget to switch back to building all packages when you are done

catkin_make -DCATKIN_WHITELIST_PACKAGES=""


Description

Whitelists only the specified packages and their dependencies by 'setting setting the CATKIN_WHITELIST_PACKAGES variable. This variable is stored in CMakeCache.txt and will persist between CMake calls unless explicitly cleared. Source: catkin_make --help

But there is an even better way

Using Catkin-Tools:

sudo apt-get install python-catkin-tools

Build specific package

catkin build <target_package>

Build the package from a directory under the package root

catkin build --this


Advantages:

  • you can call catkin build from everywhere
  • always builds packages seperately
  • catkin clean cleans everything (instead of the dangerous rm -rf build devel)
  • more infos

Important notes for catkin_tools:

  • You can't mix catkin build and catkin_make (delete your build/devel/install folders to switch tools)
  • As catkin_build builds all packages seperately there can be problems when passing information between packages via CMake. More Information


Old answer for legacy reasons

catkin_make --pkg <my_package_name>

Example:

catkin_make --pkg turtlebot

Multiple Packages:

catkin_make --pkg <package A> <package B>

But as this doesn't work robustly I recommend switching to catkin_tools which allows to build only one package and many more fancy features: