Compile source code in another package
I would like to compile the source files in package A as part of package B (i.e. not create a library from A and link it to B). Package A was written in such a way that various compiler flags can be passed in for various target installations. One solution is to create multiple libraries. This was discussed in this question, but this is problematic since there are multiple compiler options. Is there any way within the rosbuild system (or catkin) to do this.
It looks like CMake allows for this with an auxiliary source function. This could be used with rosbuild find ros package function. However, this is not recommended by CMake since it might require recompiling package A every time, or worse, missing changes in package A.