I have recently started a project using the Espressif IoT Development Framework for an ESP32 I am playing around with and I have encountered an annoying and incorrect error being detected in my project’s top-level CMakeLists.txt
file. The line where it includes the IDF’s project.cmake
file from the ESP IDF install shows an error (include could not find load file
), specifically it seems that the $ENV{IDF_PATH}
substitution is not being recognized by the CMake linter in VSCode since the error is completely missing that first part of the path ($ENV{IDF_PATH}/tools/cmake/project.cmake
becomes just /tools/cmake/project.cmake
). My code does build and run so when PlatformIO runs the build process the environment variable IDF_PATH
must be present, but VSCode doesn’t seem to be seeing it when checking for errors, so it consistently shows me 3 errors on this file. Does anyone know to make VSCode see the environment variables that the PlatformIO build system uses? I think that would solve this little issue. Just to clarify, my project builds 100% completely fine, but VSCode shows an error where it doesn’t seem it should exist.
Thanks!