Using an environment file with a WSL Toolchain on Windows



We are currently trying to get an ESP32 project building using the WSL on windows. We have an environment file setup on the toolchain to setup IDF_PATH and source the script from the ESP-IDF. However, this environment doesn't seem to be getting passed to cmake when run by CLion in the WSL. CMake is failing at the line “include($ENV{IDF_PATH}/tools/cmake/project.cmake)” in the CMakeLists.txt file, returning the error “/tools/cmake/project.cmake”. This line seems to be missing the IDF_PATH variable.



We have an environment file setup on the toolchain

  1. Did you specify the script in the “Environment file” field of your WSL toolchain in `File | Settings | Build, Execution, Deployment | Toolchains`?
  2. Where is the script located, inside the WSL instance or locally on the Windows machine?

We got it working. We had to set the IDF_PATH within the CMake environment variable setting. On top of that, we had to “invalidate caches”, with all options ticked.


Please sign in to leave a comment.