CMake on STM32 | Episode 2: build with CLion

CMake on STM32 | Episode 2: build with CLion

In this article, you will learn how to build a CMake project for STM32 and download the software to the MCU with CLion, JetBrains’ IDE for C & C++.

In episode 1, we got a BSP along with the CMakeLists.txt:

Alt Text

Finally, we built the software from the command line.

To be honest, in my everyday life, I don’t use the command line. I use instead CLion because it is much more comfortable… Let’s try it!

CMake on STM32 | Episode 1: the beginning

CMake on STM32 | Episode 1: the beginning

This article is the first of a series dealing with CMake and STM32 microcontrollers. In fact, it is more about CMake on MCUs but I had to pick one for the examples.

Why CMake? Why STM32?

CMake is becoming the de-facto standard tool to build C and C++ projects. It is becoming so popular that it will probably be the build tool for Qt6:

For Qt 6, we aim to use CMake as a standard 3rd party build system to build Qt itself. CMake is by far the most widely used build system in the C++ world, and better integration with it is sorely needed.