Controlling the CMAKE_BUILD_TYPE for a package based on the image recipe being used?
So, I have a package, let's call it "telephone", that I can build with CMAKE_BUILD_TYPE=Alpha or CMAKE_BUILD_TYPE=Beta.
For recipes-core/images/alpha.bb, I want the version of telephone installed in that image to be the version built with CMAKE_BUILD_TYPE=Alpha, and for recipes-core/images/beta.bb, I want the version of telephone installed in that image to be the version built with CMAKE_BUILD_TYPE=Beta.
Alternatively, how would I make CMAKE_BUILD_TYPE=Alpha be the default, so alpha.bb doesn't actually need to be changed at all, aside from adding telephone to its IMAGE_INSTALL:append list, but still allow beta.bb to override it.
In pure bash, I'd just use something like:
CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Alpha}"
This would allow the given envar to override the value in the bash script, but if it's not set, the value will default to Alpha, but I don't know how I would do this in a bitbake recipe.
Posted Jun 3, 2026, 7:47 PM UTC