Skip to main content
Explorer II
August 3, 2023
Solved

How to generate automatically st-project.cmake file.

  • August 3, 2023
  • 1 reply
  • 3503 views

Hi team.

I’m using VSCode with STM32 VSCode extension.

And I want to know, how to generate st-project.cmake when add new .c and .h files automatically?

Is  there any way?

Kenji1_0-1691075455485.png

 

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

    Found a way to regenerate the st-project.cmake based on https://community.st.com/t5/other-tools-mcus/including-external-header-files-in-project/m-p/54039/highlight/true#M15

    To regenerate he CMake files:

    1) Open STM32 VS CODE EXTENSION in a side bar or F1 + "Import a local STM32Cube project"

    2) Select .cproject file again

    This will scan project folders and add ALL source files into the project.

    Two issues with this:

    1) ALL source files added to the project and you can't hide or exclude.

    2) The path for include files is not added.

     

    1 reply

    Explorer
    November 28, 2023

    I am searching for the same answer. Have you found solution?

    ZDimaAnswer
    Explorer
    November 28, 2023

    Found a way to regenerate the st-project.cmake based on https://community.st.com/t5/other-tools-mcus/including-external-header-files-in-project/m-p/54039/highlight/true#M15

    To regenerate he CMake files:

    1) Open STM32 VS CODE EXTENSION in a side bar or F1 + "Import a local STM32Cube project"

    2) Select .cproject file again

    This will scan project folders and add ALL source files into the project.

    Two issues with this:

    1) ALL source files added to the project and you can't hide or exclude.

    2) The path for include files is not added.

     

    Kenji1Author
    Explorer II
    November 29, 2023

    Hi ZDima-san

    I was able to solve my problem in this way.
    Thank you!