Open CMakeLists.txt located in the root directory and change the contents to the following: cmake_minimum_required(VERSION 3.8) The project should now fail to compile because it’s not configured for C++ yet. Rename main.c to main.cpp in the folder named main. This list is the most common folders that will be used for most projects.įor this tutorial, you do not need to add the components directory to the folder structure because we are not going to use any custom components. You can add more folders as needed for example a data folder to store HTML and CSS pages for a web server. components This is where we are going to add the libraries that we will create over the next few tutorials.All other components are automatically added as dependencies saving us from having to add all of the dependencies manually. main This folder is treated specially by the ESP-IDF when in the correct position.build All the files needed during the build process are generated in this folder.Changing these settings can cause the build to fail. This folder contains the configuration and task settings for your build process. vscode This folder is also hidden in a Linux environment. This is useful if other installations interfere with your ESP-IDF environment. It contains settings if you want to run the project and build-environment in a docker container. devcontainer This folder is hidden in a Linux environment and should not be edited. If you have not built the project yet then the build folder will be absent. You should now have a folder structure that looks like the image to the left. If there is no build directory then you receive a message informing you that there is no build directory to clean. If the project builds successfully then you know that everything worked correctly. It is important to do a full clean before you build the project. The next thing to do is to clean and build the project. At this point you might encounter a message to select or create a build environment depending on which plugins you have installed, do not select any of the options. Now you can open the newly renamed folder in VS Code by clicking on File and then on Open Folder. I’m going to name this project HelloCMake. To close the folder click on File and then click on Close Folder. You need to close the project folder in VS code before you will be able to change the folder name. To change the project name, navigate to the project folder using windows explorer and manually change the folder name to whatever you want to name the project. The downside is that the project folder and project name are set to sample_project which is not ideal. vscode folder are properly created saving us a lot of headaches. Select ESP-IDF: Show Example Projects Select the current ESP-IDF framework Select sample_project and click on Create project using sample_project Give the project a nameīy creating a project from a template all of the settings in the. This will bring up the list of available example projects. When available, click on ESP-IDF: Show Example Projects and then click on Use current ESP-IDF. Begin to type ESP-IDF: Show Example Projects. Open VS Code and press Ctrl+Shift+P to open the command palette. As an Amazon Associate, I earn from qualifying purchases. Some of the following links might be affiliate links to amazon.
0 Comments
Leave a Reply. |