Eclipse CMake ESP-IDF

arnoud
Posts: 2
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:
https://cdtdoug.ca/2018/07/02/cdt-for-esp32.html

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?

arnoud
Posts: 2
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.

ESP_Angus
Posts: 1529
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.

Angus

Return to “ESP32 IDF”

Who is online

Users browsing this forum: Baidu [Spider] and 17 guests