Eclipse CMake ESP-IDF

Posts: 3
Joined: Thu Nov 22, 2018 9:19 am

Eclipse CMake ESP-IDF

Postby arnoud » Thu Nov 22, 2018 4:08 pm

I have installed the CMAKE build system and can build the hello world project.
It is much faster then building in msys2.

Next step for me was to use eclipse. I found the tutorial:

But I'm stuck at the building step:

Code: Select all

Building in: C:\projecten\esp\test2\hello_world\build\default
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=C:\projecten\esp\esp\esp-idf\tools\cmake\toolchain-esp32.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON C:\projecten\esp\test2\hello_world

Code: Select all

Errors occurred during the build.
Errors running builder 'CDT Core Builder' on project 'hello_world'.
Building hello_world
Cannot run program "C:\projecten\esp\esp\esp-idf\tools\cmake" (in directory "C:\projecten\esp\test2\hello_world\build\default"): CreateProcess error=5, Toegang geweigerd
Building hello_world
Cannot run program "C:\projecten\esp\esp\esp-idf\tools\cmake" (in directory "C:\projecten\esp\test2\hello_world\build\default"): CreateProcess error=5, Toegang geweigerd
If I try to run the command in the windows prompt, the project builds without errors.

Is there someone who has this working and can give me a hint?

Posts: 3
Joined: Thu Nov 22, 2018 9:19 am

Re: Eclipse CMake ESP-IDF

Postby arnoud » Fri Nov 23, 2018 10:45 am

Just got a step further
I am working under Windows.
Setup your Eclipse as mentioned in the URL from my previous post.

Create a new workspace for Eclipse
copy example project helloworld in your eclipse workspace folder.
open a prompt and goto the helloworld project folder in the Eclipse workspace.
Execute the following command:
cmake -G "Eclipse CDT - Ninja"

Open eclipse and Import->General->Existing Project into workspace
Eclipse will index the project and after that you can have fun.
Project building seems to work.

Downside is that all object files are in the root directory. If I put them in the build dir cmake mention Eclipse does not support that very well.

Posts: 1725
Joined: Sun May 08, 2016 4:11 am

Re: Eclipse CMake ESP-IDF

Postby ESP_Angus » Thu Feb 14, 2019 6:17 am

Hi arnoud,

Sorry for the late reply. We just stumbled across this problem ourselves.

What happens is this: Eclipse CDT searches the PATH (first Eclipse project path then environment variable PATH) for "cmake" to execute. Unfortunately it does not check if the "cmake" that it finds is an executable file.

If "$IDF_PATH/tools" is part of the search path, then Eclipse CDT tries to run the directory "$IDF_PATH/tools/cmake"...

We're going to send a patch to Eclipse to fix this, so that only executable files named "cmake" are executed.

In the meantime, if you edit the search path (either PATH environment variable or the Eclipse project search path) so that the directory which contains the cmake executable comes before "$IDF_PATH/tools/cmake", then it should start working.


Posts: 33
Joined: Fri Apr 12, 2019 4:25 pm
Location: Canada

Re: Eclipse CMake ESP-IDF

Postby bonmotwang » Wed May 22, 2019 9:25 pm

I followed the steps provided in the thread and got the hello_world running.
Build is OK, flash into WROVER board is OK. Receiving messages from printf in the terminal window is OK.
All good except the red lines all over the place because of the "Unresolved inclusion"

I was able to get rid of the "Unresolved inclusion" following the clues provided in this forum when I was using MSYS2.
Because it is way too slow, I had to give up on it and changed to cmake.

In cmake project properties I noticed that it has less items.
for example:
it doesn't have C/C++ Build
In C/C++ General it doesn't have "Preprocessor Include Path" and "Paths and Symbols".

Not too much I can do to solve this issue.

I am very close to have a dream IDE setup for ESP32. Please help through the very last mile!



Who is online

Users browsing this forum: No registered users and 20 guests