Using colcon, is there a way to skip a "top" CMakeLists.txt and detect packages in sub-folders?
I have the following file structure with a mix of legacy code and some ROS packages in a single git repository:
src/top_project/CMakeLists.txt
src/top_project/sub_project1/CMakeLists.txt # no ROS
src/top_project/sub_project2/CMakeLists.txt # with ROS
src/top_project/sub_project2/package.xml
The top_project/CMakeLists.txt
is provided for non ROS users and is just a list of add_subdirectory(sub_projectN)
. I would like colcon to ignore the top_project/CMakeLists.txt
and potentially treat each sub_project
as a separate package. I tried adding COLCON_IGNORE
but this lead to the whole directory and subdirectories being ignored. Is there something like COLCON_IGNORE_CWD
to ignore top_project
but recursively search the sub folders? To note, I'm trying to port ROS1 libraries build with python catkin build tools which relied on the fact that directories without package.xml
where ignored and we had to explicitly provide a package.xml
for each actual package.
I'm using ROS 2 Eloquent with:
> cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
> colcon version-check
colcon-argcomplete 0.3.3: up-to-date
colcon-bash 0.4.2: up-to-date
colcon-cd 0.1.1: up-to-date
colcon-cmake 0.2.18: up-to-date
colcon-core 0.5.3: up-to-date
colcon-defaults 0.2.3: up-to-date
colcon-devtools 0.2.2: up-to-date
colcon-library-path 0.2.1: up-to-date
colcon-metadata 0.2.3: up-to-date
colcon-notification 0.2.12: up-to-date
colcon-output 0.2.7: up-to-date
colcon-package-information 0.3.1: up-to-date
colcon-package-selection 0.2.5: up-to-date
colcon-parallel-executor 0.2.4: up-to-date
colcon-pkg-config 0.1.0: up-to-date
colcon-powershell 0.3.6: up-to-date
colcon-python-setup-py 0.2.3: up-to-date
colcon-recursive-crawl 0.2.1: up-to-date
colcon-ros 0.3.15: up-to-date
colcon-test-result 0.3.8: up-to-date
colcon-zsh 0.4.0: up-to-date