Is Ninja installed and available in your path? If so, you'll need to add -G Ninja as an argument to cmake.
Alternately, you can make use of the CMake presets (CMakePresets.json) that are part of each Azure Sphere project. This is described in the documentation here: https://learn.microsoft.com/en-us/azure-sphere/app-development/build-hl-app?view=azure-sphere-legacy&tabs=windows%2Ccliv2beta&pivots=cli#build-the-application
For future reference, the pivot tabs at the top of the page allow you to swap between different environments. Note that the CLI "pivot" is selected in the image below.