AWS Device SDK CPP v2 sample recipe
scooter1556 opened this issue · 2 comments
This is more or less a duplicate of #137 but I can see that currently there is only a recipe for one sample 'mqtt5_pubsub' which is required for testing the main package.
It would be good to have a single 'aws-iot-device-sdk-cpp-v2-samples' recipe which builds all samples and splits them into separate packages using PACKAGES, FILES and RDEPENDS for each sample binary.
That way all samples will be built by the recipe but the end user can individually decide which samples they include in their image and other recipes can RDEPEND on a single sample just like 'aws-iot-device-sdk-cpp-v2' does today.
Hi Scott,
yes, this would be great, but not easy to do.
Because all samples are separate cmake projects contained in the aws device sdk v2 repo, to use the cmake bbclass only one build dir is supported. Our approach is to have a common include for all samples and have a common version include for lib and samples (so that they always have the same version). With this, adding a new example is as easy as copying the example recipe, rename and point to a different subdir.
Of course, there could be a meta samples recipe including (RDEPEND) all samples.
May you have already a better solution in mind - you're very welcome to contribute.
@thomas-roos thanks for the details. There used to be a CMake file in the root of the 'samples' directory which made this easier but I see that is gone so yes, I agree, not as easy as I hoped.
The logical option but quite messy would be as you suggest, a recipe per sample and possibly a 'dummy' recipe which pulls in all samples. The other option would be to include a patch adding back the CMake file in the root of the 'samples' directory which simply contains
add_subdirectory(sample1)
add_subdirectory(sample2)
Appreciate none of these are particularly elegant.