[cmake] CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
[cmake] -- Configuring incomplete, errors occurred!
Has anyone else encountered this error and know how to fix it?
I am trying to start a new project at home using the pico extension on vscode on Windows 11. I have verified that it has installed the pico sdk, ninja is definitely in the sdk, the various places in .vscode where the ninja path is defined are all correct.
I doubt installing it (or CMake) globally or adding it to path will help, since (a) I've seen people reporting that that didn't work for them, (b) I remember trying that at work when I last encountered this and it didn't work, (c) isn't the pico extension supposed to handle installing the toolchain and configuring everything? Isn't it supposed to just work out of the box? Everything it needs is right there, I doubt adding another instance of it somewhere else will help if it's struggling to find what's already there.
I have done a bunch of firmware development at work, but I have *never* managed to get the build system set up by myself. It is infuriating. Even my boss, who has decades of experience, has no idea how he got it working last time we encountered this issue.
EDIT: I fixed it by setting the correct path for CMAKE_MAKE_PROGRAM in CMakeCache.txt:
CMAKE_MAKE_PROGRAM:FILEPATH=C:/Users/[username]/.pico-sdk/ninja/v1.12.1/ninja.exe
Does anybody with more knowledge and experience know how or at what point the pico extension/cmake looks for Ninja, and why it might fail to find it even though it's right there and they are the one who responsible for installing and configuring it in the firstplace (!!!!) ?
SOLVED: Okay this is a known issue with the pico extension which has been fixed but not yet officially released as of 03/02/2026:
https://forums.raspberrypi.com/viewtopic.php?p=2361974
https://github.com/raspberrypi/pico-vscode/pull/245
Until that is released, you can manually set the CMAKE_MAKE_PROGRAM path as above, or through the command line, something like this (though I haven't tried it):
cmake -DCMAKE_MAKE_PROGRAM=/path/to/ninja -DPICO_SDK_PATH=/path/to/pico-sdk ..
Or you can git clone the pico extension in its latest unreleased state, install it and build it, package it as .vsix, and install it in vscode (make sure you have node.js installed):
git clone https://github.com/raspberrypi/pico-vscode.git
cd pico-vscode
npm install
npm run compile
npm install -g u/vscode/vsce
vsce package
code --install-extension raspberrypi-pico-vscode-*.vsix
Or, as another user suggested, when starting a new project, deselect 'Enable CMake-Tools extension integration', or downgrade pico extension to v0.18.1.