Skip to main content
Explorer II
July 3, 2024
Solved

How to stop STMCubeMX updating the cmake file

  • July 3, 2024
  • 1 reply
  • 2220 views

Hi All,

I use VSCode+STM32 plug-in and it works great, however, one problem I have is that every time I run STMCube32mx it updates the cmake file (CMakeLists.txt). There is no /*USER CODE */ section in this file so I have to constantly fix the CMakeLists.txt file with my additions.

I checked STM32CubeMX project manager settings and there is no option to not generate a build file and there are no options to add your settings.

Any idea?

Thanks,
Hans.

    This topic has been closed for replies.
    Best answer by hans86

    Just in case somebody else hits this issue, the STM32 plug-in handles this issue by providing 2 CMakeLists.txt files as shown below. The first (top) one is modified when you execute STM32CubeMX and the second one is for user additions and is only generated once as stated in the header.

    hans86_0-1723802401102.png

    I am sure this is described in the manual but you know how it is.....

    Regards,
    Hans.

    1 reply

    hans86AuthorAnswer
    Explorer II
    August 16, 2024

    Just in case somebody else hits this issue, the STM32 plug-in handles this issue by providing 2 CMakeLists.txt files as shown below. The first (top) one is modified when you execute STM32CubeMX and the second one is for user additions and is only generated once as stated in the header.

    hans86_0-1723802401102.png

    I am sure this is described in the manual but you know how it is.....

    Regards,
    Hans.