Releasing private catkin packages with bloom in legacy codebase
I have the following scenario. We have a legacy codebase, all in one git-repository, with different modules and a legacy build system (in fact there are 4 different build systems already, 2 of them in daily used, qmake on Linux and vs in Windows). I want to create catkin packages for the individual modules and release them into a private rosdistro.
Because the code base will continue to be used with the legacy build system in non-ROS context, I have limited freedom to restructure and change things. I would like to be as unintrusive to the current layout and structure as possible, in order to not be faced with acceptance problems in parts of our team that are not using ROS (yet).
I have gotten as far as creating the catkin packages, making sure they work with the install space (see also a previous question) and releasing them with bloom into a private rosdistro. Now I want to build debians for the released packages (first manually, later with buildbot-ros or eventually with a private buildfarm setup). I am confronted with some issue that I will describe in the following.
The repository layout is as follows:
foo-project
├── config.h
├── external-libraries
│ └── libbar
│ └── bar.h
├── module1
│ ├── package.xml
│ ├── CMakeLists.txt
│ └── ...
├── module2
│ ├── package.xml
│ ├── CMakeLists.txt
│ ├── module2.h
│ └── ...
├── module3
│ ├── package.xml
│ ├── CMakeLists.txt
│ └── ...
├── ...
...
1. Header files outside the package directory
The first issue is that there is a header file config.h
in the project root. It is included with #include "../config"
in the headers of module1
(which are in turn included by other modules). I install the config.h
together with the headers of module1
, but I still need it to be in-reach at build-time of module1
, which is not the case for the bloom-released branches, that contain only the module
folder, not its parent. How could I inject this file into the bloom-released branch?
2. External library files at build time
In module1
, the third party library libbar
is included. It needs to be only there at build time, and not installed / exported. In the current module build-definition there is a include_directories(../external-libraries/libbar)
and then in the source files of module1
it is referenced simply as #include "bar.h"
. Similar to the previous issue, I need to make these header files available at build time. But the difference is, that I don't need install them, and that they are not in the repository root, but in a parallel subfolder. This would make it possible to wrap them up in a foo_external_libs-dev
catkin package.
3. Interdependencies between modules
Mostly the dependencies between the different modules can be mapped to a tree structure, with module1
at the root. This is reflected in the dependencies as declared in the package.xml
files. However, to build the individual modules, there are unfortunately cyclic interdependencies. E.g. to build module1
, module2.h
is needed. When building in a catkin workspace, this works because the CMakeLists.txt
of module1
has a include_directories(../module2)
. It is also ...