Building multiple projects in a single part?

The source tarball for my project contains 3 different sub-directories, each containing a different project which has to be compiled separately, something like this:

cd extracted-source-directory
cd project1
cmake .
make
make DESTDIR=/path/to/package/directory install
cd ../project2
cmake .
make
make DESTDIR=/path/to/package/directory install
cd ../project3
cmake .
make
make DESTDIR=/path/to/package/directory install

I need them all to be in the same part, but in the snapcraft.yaml, you can only supply one project per part. So is it possible to include all three of these under a single part in the snapcraft.yaml?

just use override-build: |, then you can use exactly what you showed above … (make sure DESTDIR points to $SNAPCRAFT_PART_INSTALL) …

1 Like