Use updated headers when building with catkin
Hi,
I started using the new catkin-based buildsystem for a recent project (currently with fuerte). It is working quite well and I see the advantages compared to rosbuild, but still there remain a couple of open questions:
Whenever I update a header file in one of the packages I have to delete the include folders in the buildspace and installspace. Otherwise cmake uses the old incompatible header files found in these directories. Is there a way to force the compiler to prefer the source header files?
Which setup.sh should be used when with catkin workspaces? Are the following (simplified) assumptions correct?
- workspace/setup.sh basically sets the ROS_PACKAGE_PATH. This is required for tools like roscd and rospack. Catkin itself does not use the ROS_PACKAGE_PATH. ROS_MASTER_URI is also set here for whatever reason.
- buildspace/setup.sh sets the PATH variable and sources further setup files in buildspace/etc/catkin/profile.d, which allows running binaries in buildspace/bin. I assume the libraries in buildspace/lib are found using the rpath mechanism.
- installspace/setup.sh adds installspace/bin to the PATH and adds installspace/lib to the LD_LIBRARY_PATH, so that installed binaries can be run from there.
- As the installspace is also part of my workspace as it is shared between multiple workspaces, sourcing workspace/setup.sh would also load the runtime configuration for the installspace.
If I want tools like roscd to find the correct source directory of a package, I have to take care that the installspace entries in my workspace/.rosinstall come first and the workspace entries overwrite the package path. The buildspace/setup.sh script has to be sourced separately after workspace/setup.sh, so that the buildspace runtime configuration is used instead of the installspace.
- Is it possible to mimic the old in-source build behavior e.g. by setting some cmake variables (use no dedicated buildspace)?