VScode Linux new install CMake IDF_PATH not working

robinelvin
Posts: 1
Joined: Sat Mar 06, 2021 6:47 pm

VScode Linux new install CMake IDF_PATH not working

Postby robinelvin » Sat Mar 06, 2021 6:57 pm

I've just installed the extension and used the Express setup option. I opened an empty folder and selected F1 -> ESP-IDF Create Project
I selected the current folder and then selected template-app which created a new folder with the sample app inside. However the problem I have is the CMakeLists.txt file is complaining that it cannot find the included project.cmake file. My settings.json is:

Code: Select all

{
    "cmake.configureOnOpen": true,
    "C_Cpp.updateChannel": "Insiders",
    "editor.fontSize": 12,
    "idf.espIdfPath": "/home/rob/esp/esp-idf",
    "idf.pythonBinPath": "/home/rob/.espressif/python_env/idf4.2_py3.8_env/bin/python",
    "idf.customExtraPaths": "/home/rob/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin:/home/rob/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin:/home/rob/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin:/home/rob/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin:/home/rob/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200709/openocd-esp32/bin",
    "idf.customExtraVars": "{\"OPENOCD_SCRIPTS\":\"/home/rob/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200709/openocd-esp32/share/openocd/scripts\"}"
}
CMakeLists.txt

Code: Select all

# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(template-app)
The included file does exist in the path. I think somehow the ENV variable isn't being found. Can anybody help?

ESP_bignacio
Posts: 214
Joined: Wed May 02, 2018 12:12 pm

Re: VScode Linux new install CMake IDF_PATH not working

Postby ESP_bignacio » Mon Mar 08, 2021 7:24 am

The CMake extension doesn't share Espressif extension settings. Maybe add the value of idf.espIdfPath to CMake Environment variables by searching for cmake.buildEnvironment in your Visual Studio Code settings ?

Who is online

Users browsing this forum: No registered users and 16 guests