cancel
Showing results for 
Search instead for 
Did you mean: 

CMakeLists.txt should use file(GLOB_RECURSE) instead of manually listing each source file for better user experience

ianzone
Associate III
When generating a CMake-based STM32 project, STM32CubeMX currently lists every single .c source file manually in CMakeLists.txt.
 
This brings major inconvenience for users:
  • When adding user drivers (e.g., sensor, flash, display, or custom modules), users must manually edit CMakeLists.txt and add each new .c file path.
  • If the user adds many source files, this process is error-prone and inefficient.
  • It does not match modern CMake project practices and reduces project maintainability.
 
Suggestion:

Please use file(GLOB_RECURSE ...) to automatically include source files from standard directories such as:
  • Core/Inc/*.h
  • Core/Src/*.c
0 REPLIES 0