COMPONENT_SRCDIRS not automatically updated

Sysprogs forums Forums VisualGDB COMPONENT_SRCDIRS not automatically updated

Tagged: 

This topic contains 7 replies, has 2 voices, and was last updated by  support 1 year, 8 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #24773

    tiolatech
    Participant

    I’m setting up an ESP32 project in Visual studio. According to the guide: https://visualgdb.com/tutorials/esp32/esp-idf/, specifically step 14, where it says VisualGDB will automatically edit the COMPONENT_SRCDIRS variable, that does not happen for me.

    Am I missing a configuration here?

    #24789

    support
    Keymaster

    Hi,

    Thanks for reporting this. We have tried reproducing the issue on our side (ESP-IDF 3.3, GNU Make-based project), however the COMPONENT_SRCDIRS variable got edited as expected, hence the problem must be caused by some other setting.

    Please confirm that the problem can be reproduced on a project created from scratch and let us know the exact settings you specify in the wizard so that we could look into this.

    Please also note that the tutorial shows the older GNU Make-based project. The newer CMake-based projects specify each source file in the CMakeLists.txt explicitly and hence the COMPONENT_SRCDIRS variable is not used.

    #24825

    tiolatech
    Participant

    Hi. Thanks for the response.

    I didn’t start a project from scratch; I tried starting with the hello-world example project. I can compile and upload, no problem.

    The problem is when I want to add a new file. Here’s what I do (using the hello-world project):

    1. Right click on “Source Files” > Add > New Item
    2. In the dialog box, I select a C source file, then set the file name to “test.c” and added a folder path (just a backslash with a new folder name – like the guide). Then click “Add”
    3. I observed the CMakeLists.txt file (the one inside the “main” folder) opens automatically, and the first line changes  to this: “set(COMPONENT_SRCS “hello_world_main.c” testdir\test.c)” – this of course, doesn’t compile.

    Could you please try to reproduce this?

    And also perhaps consider updating the guide.

    Thanks very much 🙂

    • This reply was modified 1 year, 8 months ago by  tiolatech.
    #24837

    support
    Keymaster

    Thanks for the detailed description. Indeed, VisualGDB was not automatically converting backward slashes to forward slashes for source paths in CMake-based ESP-IDF projects. We have reproduced and fixed the issue in the following build: VisualGDB-5.4.105.3141.msi

    The current tutorial covers the GNU Make-based ESP-IDF projects, and hence uses the different variable names. We will try to publish another tutorial covering CMake-specific setup steps in the next few weeks.

    #24845

    tiolatech
    Participant

    Excellent! Thanks for the super-fast response!

    The new build works.

    How do I go about adding header files?

    #24852

    support
    Keymaster

    Good to know it works. The mechanism for adding header files is the same: Add->New Item->C/C++ Header File. VisualGDB will automatically create the ‘Header Files’ filter in Solution Explorer for CMake targets that have header files.

    Please note that as ESP32 projects have the automatic header search option enabled by default (VisualGDB Project Properties -> CMake project settings -> Automatically find header files), the CMakeLists.txt won’t be modified, as all header files from the source directories will get discovered automatically.

    #24870

    tiolatech
    Participant

    Nice! I’m up and running!

    You’ve been tremendous help! Thanks for the amazing support! 🙂

    #24871

    support
    Keymaster

    No worries. If you encounter any further issues, don’t hesitate to start another thread and we will be happy to help.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.