Changing the generator in a CMake recipe needs to somehow clear out ${B} and force do_configure to start from scratch. Otherwise you get errors from CMake like: CMake Error: Error: generator : Ninja Does not match the generator used previously: Unix Makefiles Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory. Perhaps something like: do_patch[vardeps] += "OECMAKE_GENERATOR" but maybe there is a more elegant way.
My bad, I was using a version of cmake.bbclass that was missing this part: if [ "${S}" != "${B}" ]; then rm -rf ${B} mkdir -p ${B} cd ${B} else find ${B} -name CMakeFiles -or -name Makefile -or -name cmake_install.cmake -or -name CMakeCache.txt -delete fi Sorry for the noise.