Skip to main content
Nicholas Parker
Associate III
February 10, 2026
Question

cube-cmake not recognised

  • February 10, 2026
  • 1 reply
  • 408 views

Hi,

Within VSCODE terminal my ninja build (from MX cmake project) will run just great.   But in the Winwows CLI I get 'cube-cmake '  is not recognised.....

When I add 

%USERPROFILE%/.vscode/extensions/stmicroelectronics.stm32cube-ide-build-cmake-1.43.0/resources/cube-cmake/win32 to the PATH, windows says ''cube' command is not available in current context'

I'm looking for some clues to understand the issue a bit better!

Thanks in advance,

Nick

 

1 reply

ST Employee
February 10, 2026

@Nicholas Parker 
I am not sure why you are trying to use `cube-cmake` as part of a command-line interface (CLI) workflow. `cube-cmake` is designed to enable proper STM32Cube integration with CMake Tools extensions. So it is intended for use in the Visual Studio Code environment.

Your issue concerns the availability of the `cube` service, not `cube-cmake`. In the Visual Studio Code integrated terminal, execute the following command:

cube bundle install cube-wrapper

This command installs the cube utility. You can then use the utility, possibly updating your $PATH to include its location.
You might be looking for then:

cube cmake --version
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Nicholas Parker
Associate III
February 10, 2026

Thanks for the reply @vincent_grenet .  The reason for this question is the following.

I was building in windows CLI.     I run
'cmake --preset Debug'

in  windows CLI andf then

'cd build/Debug'

to generate my makefiles from the cubeMx cmakefile.   

I can then run 'ninja clean' or 'ninja' etc to build the project (also in Windows CLI)

Back in VSCode, when I swap projects back to a this project, from another, the extension remakes some of the build files.   If I now run 'ninja' on the CLI, it responds with

'cube-cmake' is not recognized as an internal or external command,"

However, if I run ninja in the VSCODE terminal window it still builds my project.   So I guess its some kind of environment thing, which is geting modified preventing a build outside of VSCode.

If i re-run 'cmake --preset Debug' in CLI it gets fixed.     

Hence why I was asking about cube-cmake.


Nick



Cartu38 OpenDev
Graduate II
February 10, 2026

@Nicholas Parker 
May it come from

Cartu38OpenDev_0-1770757099811.png

Such said same as @vincent_grenet I'm unclear about your workflow.
.vscode/settings.json only operates if VS Code in use ... not impacting CLI execution out of VS Code for sure.
Re-created files may come from the fact you're engaging various version of cmake / ninja.
What about ? 

cmake --version
cube cmake --version
ninja --version
cube ninja --version