Add support for building the whole repo as a single CMake project #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For integration with CMake-based workflows like the one based on
FetchContent
orExternalProject
(like therobotology-superbuild
) cmake modules, it is convenient to be able to build the repository as a single CMake project.The most naive way of supporting this would be to just add a
CMakeLists.txt
to the root folder of the repo, but that would problematic as it would influence also the workflow of building the repo viacolcon
, as it would force the serial configuration, build and install of each subproject of the repo, as oppose to the parallel configuration, build and install of each subproject permitted by colcon. For this reason, I used another strategy: I created a new folderxcub_moveit2_all_packages
that contains the following minimal content required to build the repo as a single CMake project:However, in this folder I also added a
COLCON_IGNORE
file, to ensure that the directory is ignored by colcon builds.In this way, users that want to install the repo as a single cmake project can by doing:
git clone https://github.com/icub-tech-iit/xcub-moveit2/ cd xcub-moveit2/xcub_moveit2_all_packages cmake -Bbuild -S. cmake --build build cmake --install build
without interfering with the usual colcon workflow: