Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE CMake integration

Associate III

Since it took a tremendous amount of effort in getting CMake working within STM32CubeIDE, I'd thought I'd share a method of getting it done. I've only tested this working in Windows. Many an hour could have been saved if ST, in their infinite wisdom, did not disable the Toolchain tree entry in the project C/C++ properties!

Disclaimer: I'm not an experienced Eclipse user, so there is a very good chance that the steps below are not the correct way of doing things, and in future, ST might lock-down or hide more UI rendering these steps useless - you have been warned!

There are a huge number of steps required, so this is not for the fainthearted!

Prerequisite: You must have an existing CMake GNU Arm project up and running, if not, find out how set one up, or use CLion to create a CMake project from an existing STM32CubeMX .ioc.

For the steps, I'm using the following folder layout (adjust to fit your preferences):

Source (source code, folders, etc)
    .. this where I set CMake to run the builds..
    MyProject (the skeleton project created in the below steps)



Hi @xlrl​ ,

It is recommended to describe the issue you are currently facing in a new post.

Any way I add our STM32CubeIDE expert in the loop in order to update us on the status of the CMake integration with latest IDE release @Semer CHERNI​ .


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.

Okay, understand. Thanks! I created a new question.


Associate III

Seems like CMake is now integrated with CubeIDE, making this thread irrelevant ?


I follow this steps but I cannot find CMAKE_EXPORT_COMPILE_COMMANDS Compiler Built-ins in Provider.

Could anyone help me? thanks

have you seen this page yet?  I take a very different approach to cmake with STM32