On VOXL1, we've done this via a Docker image.
The image might be a bit out of date, but the idea remains the same:

https://gitlab.com/voxl-public/voxl-docker-images/voxl-docker-mavsdk-cpp