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: