Hi,
I'm working to make a template for
ROS projects in Code::Blocks. I've got it mostly figured out (and would be quite happy to share it), except for some misunderstandings about configuring the CB shell environment. ROS uses custom Makefiles that call cmake using the shell macro. The Makefile is:
include $(shell rospack find mk)/cmake.mk
This would normally return the path to the cmake template (i.e, something like "/opt/ros/ros/core/mk") with the /cmake.mk appended to the end of the path.
I enabled custom Makefiles in CB, but it doesn't work because the PATH variable does not include the directory for rospack. This is expected, as a traditional installation from source for ROS requires you to modify your ~/.bashrc as follows:
source /opt/ros/setup.bash
This is where I've run into problems. How do I do a similar configuration in the CB environment on a per-project level? I tried simply putting the "source ..." line into the pre-build steps, but that gives the error
/bin/sh: source: not found
All setup.bash does is some shell configuration (that is probably unnecessary for CB) and then calls setup.sh which is a file full of export commands to various shell variables (including PATH). I'd rather not copy the relevant variables out of the scripts however, as that results in a static solution that isn't very portable. The setup scripts are distributed as part of ROS, so using them would mean the template project would stay up-to-date with any configuration changes.
Can anyone provide any insight?
Thanks.