How to integrate CMSIS-DSP libraries on a CMake STM32 project
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-06-13 7:57 PM
Hello all
I am trying to integrate CMSIS-DSP in my CMake project. From CubeMX, I have the following options:
and I see the following folder struct:
and to include DSP folder in my project, I have done the following changes in my top level CMakeLists.txt
.... some code
# Enable CMake support for ASM and C languages
enable_language(C ASM)
# Create an executable object type
add_executable(${CMAKE_PROJECT_NAME})
# Add STM32CubeMX generated sources
add_subdirectory(cmake/stm32cubemx)
add_subdirectory(Drivers/CMSIS/DSP/Source)
# Link directories setup
target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE
# Add user defined library search paths
)
# Add sources to executable
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
# Add user sources here
${CMAKE_SOURCE_DIR}/Core/Src/tm1638.c
)
# Add include paths
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
# Add user defined include paths
# Include CMSIS core headers
${CMAKE_SOURCE_DIR}/Drivers/CMSIS/Include
${CMAKE_SOURCE_DIR}/Drivers/CMSIS/DSP/Source
)
# Add project symbols (macros)
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
# Add user defined symbols
)
# Add linked libraries
target_link_libraries(${CMAKE_PROJECT_NAME}
stm32cubemx
# Add user defined libraries
CMSISDSP
)
..... more code
View more
However, while performing add_directory for DSP, I get the following error
[cmake] Build type: Debug
[cmake] CMake Error at Drivers/CMSIS/DSP/Source/CMakeLists.txt:12 (include):
[cmake] include could not find requested file:
[cmake]
[cmake] configLib
[cmake]
[cmake]
[cmake] CMake Error at Drivers/CMSIS/DSP/Source/BasicMathFunctions/CMakeLists.txt:5 (include):
[cmake] include could not find requested file:
[cmake]
[cmake] configLib
[cmake]
[cmake]
[cmake] CMake Error at Drivers/CMSIS/DSP/Source/BasicMathFunctions/CMakeLists.txt:6 (include):
[cmake] include could not find requested file:
[cmake]
[cmake] configDsp
[cmake]
[cmake]
[cmake] CMake Error at Drivers/CMSIS/DSP/Source/BasicMathFunctions/CMakeLists.txt:34 (configLib):
[cmake] Unknown CMake command "configLib".
[cmake]
[cmake]
[cmake] -- Configuring incomplete, errors occurred!
[proc] The command: "C:\Program Files\CMake\bin\cmake.EXE" -DCMAKE_BUILD_TYPE=Debug
Question is, am I configuring anything wrong in CubeMX? From where should I bring configDSP and configLib?
Labels:
- Labels:
-
STM32F4 Series
0 REPLIES 0
