cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Source Files to CMake Project

ghincher
Associate

Hi all,

 

I've been using CubeIDE for a little while and decided to build my next project using the STM32 VSCode extensions, which I am still figuring out. I am also figuring out CMake for the first time, as I let CubeIDE handle all the build details previously. In the past, CubeIDE let me add .h and .c files through the UI and automatically added them to the build process. I've found that I can make my own files and still build by manually altering the CMakeLists.txt file under the stm32cubemx directory, but I find myself editing the ioc file often enough that I'd rather not do this every single time I want to make a small change, and as the project size grows. All the drivers I've needed so far are part of CubeMX's middlewares, but if I do download a third party driver I foresee this becoming an issue there as well. Are there any workarounds to include manual additions to the generated CMake file? I'd like to utilize an STM feature if possible before I try making my own cmake files or throwing a bash script at the issue. Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
ghincher
Associate

Edit: I was not aware there were user sections in the top level CMakeLists, I was looking in cmake/stm32cubemx. Think I figured it out. 

View solution in original post

1 REPLY 1
ghincher
Associate

Edit: I was not aware there were user sections in the top level CMakeLists, I was looking in cmake/stm32cubemx. Think I figured it out.