This is an old revision of the document!
To compile only one ROS package in a catkin workspace use
catkin_make --pkg MY_PACKAGE_NAME
Please note, that this will still call CMake (and use CMakeLists.txt) to generate Makefile's for ALL the packages of your workspace, but compiling, i.e. calling the GNU compiler with Makefile's will be only performed on MY_PACKAGE_NAME
The equivalent of calling catkin_make
in the workspace root directory is
cd ~/workspace/catkin/build cmake ../src make MY_PACKAGE_NAME
The equivalent of $ROS_PACKAGE_PATH for catkin is the CMake environment variable $CMAKE_PREFIX_PATH, which will usually point to your ros distro (i.e. /opt/ros/super-turtle-distro-name) and the devel
directory of your catkin workspace (workspaces). So it seems that CMake doesn't need to know where your source files are, but it need to know where the makefiles of your packages are and other similar stuff, and they are in the devel directory, and then the makefiles in their turn point to your packages in the source directory. So that's why I guess if you delete your devel directory and source ~/.bashrc, ros will not be able to find any catkin packages anymore. And your whole environment setup is in devel
as well. So, to summarize, catkin (and ros in general) doesn't care about where your package sources are stored, what is crucial are the corresponding files from devel
generated for each of your catkin packages.