This is an old revision of the document!
# Build a ROS Package - Method A
<note important>This needs to be confirmed, but it should work…</note>
## Base method
When you need to build a separate package for ROS, instead of going throught all the steps like in the installation process, this should work
mkdir -p temp_dir/src cd temp_dir/src # Here, put your package_folder cd ../ # Maybe you can try this to resolve the dependencies, but I'm reaaaaally not sure 'bout that... #rosdep install --from-paths src --ignore-src --rosdistro hydro -y -r --os=debian:wheezy sudo /opt/ros/hydro/env.sh catkin_make_isolated -DBUILD_BINARY_PACKAGE=ON -DCMAKE_INSTALL_PREFIX=/opt/ros/hydro -DCMAKE_INSTALL_LIBDIR=lib --install --merge --install-space /opt/ros/hydro
Aaaannd, that's it.
## Ubuntu variant
This procedure is useful for users who have installed ROS packages from the “official” repositories and want to update a package with a newer source, so it's mainly for Ubuntu users. The _difference_ is that sudo needs to source /opt/ros/hydro/setup.bash to launch catkin_make:
sudo bash source /opt/ros/hydro/setup.bash catkin_make_isolated -DBUILD_BINARY_PACKAGE=ON -DCMAKE_INSTALL_PREFIX=/opt/ros/hydro -DCMAKE_INSTALL_LIBDIR=lib --install --merge --install-space /opt/ros/hydro exit
And it should be done!
# Build a ROS Package - Method B This one doesn't directly rely on catkin, it doesn't manage dependencies though…
mkdir yourpackage git clone --branch release/hydro/@package_name@/@package_branch@ @git_repository@ @package_name@ mkdir build cd build cmake ../@package_name@ -DSETUPTOOLS_DEB_LAYOUT=OFF -DCATKIN_BUILD_BINARY_PACKAGE=ON -DCMAKE_INSTALL_PREFIX=/opt/ros/hydro -DCMAKE_INSTALL_LIBDIR=lib make sudo make install
This method comes from the Archlinux PKGBUILDs, it works on Debian like this. There should be a way to checkinstall make install… and then we could (fully) package ROS for Debian in an easy, kinda automatic way…