Sysprogs forums › Forums › VisualGDB › COMPONENT_SRCDIRS not automatically updated
Tagged: esp32
- This topic has 7 replies, 2 voices, and was last updated 5 years, 6 months ago by support.
-
AuthorPosts
-
April 25, 2019 at 07:02 #24773tiolatechParticipant
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?
April 25, 2019 at 19:48 #24789supportKeymasterHi,
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.
April 27, 2019 at 23:39 #24825tiolatechParticipantHi. 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):
- Right click on “Source Files” > Add > New Item
- 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”
- 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 5 years, 6 months ago by tiolatech.
April 28, 2019 at 22:38 #24837supportKeymasterThanks 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.
April 29, 2019 at 18:20 #24845tiolatechParticipantExcellent! Thanks for the super-fast response!
The new build works.
How do I go about adding header files?
April 29, 2019 at 20:07 #24852supportKeymasterGood 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.
April 30, 2019 at 20:38 #24870tiolatechParticipantNice! I’m up and running!
You’ve been tremendous help! Thanks for the amazing support! 🙂
April 30, 2019 at 20:48 #24871supportKeymasterNo worries. If you encounter any further issues, don’t hesitate to start another thread and we will be happy to help.
-
AuthorPosts
- You must be logged in to reply to this topic.