PlatformIO Community

ESP-IDF: Build your Project Error

After successfully setting up the ESP-IDF environment I try to run an example project “Hello World”. Unfortunately during the build I get the error below:
##############################################################################
cmake : The term ‘cmake’ is not recognized
script file, or operable program. Check the
was included, verify that the path is corre
At line:1 char:1

  • cmake -G Ninja …
  •   + CategoryInfo          : ObjectNotFoun
     ndException
      + FullyQualifiedErrorId : CommandNotFou
    

###########################################################################
I have the CMAKE path present in the ENV, I am not sure what I am missing. Has someone seen this issue and was is the solution.
In addition I do see the path on power shell.

PlatformIO does explicitly not use the cmake found in a user’s environment, it brings its own of a specific version and uses that.

Can you show your whole project structure and files and the result of pio run -v (or “Verbose Build” in VScode)?

image

Thanks for your reply I am new to Platformio, thus I am not sure exactly what you mean by pio run -v. Do you see the print screen I have attached?

o_O? You just imported a pure ESP-IDF hello world project, but without the platformio.ini config.

Please read through https://docs.platformio.org/en/latest/frameworks/espidf.html and see https://github.com/platformio/platform-espressif32/tree/develop/examples/espidf-blink. You need at least a platformio.ini to make it a PlatformIO project.

Okay, let me read this documentation. Thanks

This looks like a mixup. It seems you have followed instructions provided by the ESP-IDF framework hot to setup the environments and tool. Thus you write:

However, PlatformIO takes a different approach. It will set up the environment and all the tools for you. But you have to create the project somewhat differently, e.g. by using PlatformIO’s New Project command (accessible from PlatformIO Home).

So you need to decide which route to go:

  • Native ESP-IDF (with cmake), or
  • ESP-IDF with PlatformIO

In the later case, see https://docs.platformio.org/en/latest/tutorials/espressif32/espidf_debugging_unit_testing_analysis.html for an introduction.