Hello,
I use STM32CubeMX V6.11.1 with cmake version 3.28.1 (the one embedded in STM32CubeCLT_1.15.1) to generate a project for STM32F746G Discovery kit.
When trying the new cmake project generation feature in conjunction with CubeAI, the generated project is not building.
I get the error:
```
[build] Starting build
[build] Build finished with exit code -1
[cmake] -- Configuring done (1.8s)
[cmake] Build type: Debug
[cmake] CMake Error at CMakeLists.txt:64 (target_link_libraries):
[cmake] Cannot find source file:
[cmake]
[cmake] C:/projects/st_trials/X-CUBE-AI/App/network.c
[cmake]
[cmake]
[cmake] CMake Error at CMakeLists.txt:38 (add_executable):
[cmake] No SOURCES given to target: ai_app
[cmake]
[cmake]
[cmake] CMake Generate step failed. Build files cannot be regenerated correctly.
```
This issue is due to the file `cmake\stm32cubemx\CMakeLists.txt` being incorrectly generated and containing two issues:
The first one is that all over the file some path are one level too high, for example:
```
target_include_directories(stm32cubemx INTERFACE
../../X-CUBE-AI/App
../../X-CUBE-AI
../../Core/Inc
../../../Middlewares/ST/AI/Inc #<---incorrect path
../../../X-CUBE-AI/App #<---incorrect path
../../Drivers/STM32F7xx_HAL_Driver/Inc
../../Drivers/STM32F7xx_HAL_Driver/Inc/Legacy
../../Drivers/CMSIS/Device/ST/STM32F7xx/Include
../../Drivers/CMSIS/Include
)
```
The second one is that for some reason in `target_include_directories` the main includes are omitted (e.g. ` ../../Core/Inc`)
Once corrected, the project builds but everytime the project is regenerated, the file `cmake\stm32cubemx\CMakeLists.txt` is overwritten and the correction have to be redone. Is there a way to have the project correctly building after generation?
Thanks in advance for the response