cancel
Showing results for 
Search instead for 
Did you mean: 

What is the proper way to include the DSP library in a CMake project?

Rob.Riggs
Senior

I am using STM32CubeMX 6.12.0 to generate a CMake project for VSCode on Linux. In the Software Packs Component Selector, I have chosen to include the DSP library.

RobRiggs_0-1721155690475.png

STM32CubeMX includes the library and headers when generating code. So far, so good.

However, the include path, linker path and library are not specified in the the generated CMake files. I would expect these to be included by STM32CubeMX. But, not a problem. I can add them myself.


target_include_directories(stm32cubemx INTERFACE
...
../../Drivers/CMSIS/DSP/Include
)
...

target_link_directories(stm32cubemx INTERFACE
../../Drivers/CMSIS/DSP/Lib/GCC
)

target_link_libraries(stm32cubemx INTERFACE
arm_cortexM4lf_math
)
 
The problem with this approach is that when making changes to the IOC file and regenerating code, the CMake files are overwritten and these changes are not preserved.
 
First, I expect that STM32CubeMX will add the necessary paths and libraries to the CMake files when specifiying additional software packs. Is this unreasonable?
Second, I expect that STM32CubeMX provides a way for developers to add customizations to the generated CMake files, and that STM32CubeMX preserves those customizations. Is there a proper way to do this that I am missing?
 
How are developers expected to interact with STM32CubeMX and the generated CMake files when adding additional software packs to a build? I have not seen this spelled out clearly anywhere.
 
0 REPLIES 0