Eclipse build in subdirectory configuration
Posted: Thu Dec 31, 2020 4:10 am
I am new to the ESP-IDF but have used Eclipse with NXP, TI, Silicon Labs, and ST.
The installation of ESP-IDF and Eclipse went pretty well after I ignored the "minimum version" requirements for Python and git and just installed the latest versions of those tools before installing ESP-IDF.
ESP-IDF Instructions:
https://docs.espressif.com/projects/esp ... t-started/
Eclipse Instructions:
https://github.com/espressif/idf-eclipse-plugin
Now it is possible to import an ESP-IDF example project, compile it in Eclipse, and resolve symbols just like a real IDE. Perfect.
But the example project that I want to use is not in the ESP-IDF examples. It is
https://github.com/espressif/esp-aws-iot
The difference seems to be that to manually build the ESP-IDF examples, you run idf.py build from the project directory. To build the esp-aws-iot examples, you have to run idf.py build from the subdirectories: examples/subscribe_publish or examples/thing_shadow.
In the Launch Configuration that I made when importing the project, I set the build directory to examples/subscribe_publish and the build command to idf.py build.
The build messages show that it is still attempting to build in the top project directory and getting confused with CMakeLists.txt.
Building manually in a CMD window would be tolerable but the project also does not resolve any of the ESP headers or functions which is the best part of Eclipse.
I realize that it would be possible to completely restructure the project to resemble the examples but that would impair the ability to get upstream changes via git.
Here is the command window output:
Building in: C:\Users\Mark\esp\projects\esp-aws-iot\build
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=C:\Users\Mark\Desktop\esp-idf\tools\cmake\toolchain-esp32.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DIDF_TARGET=esp32 C:\Users\Mark\esp\projects\esp-aws-iot
CMake Error at CMakeLists.txt:26 (register_component):
Unknown CMake command "register_component".
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.13)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring incomplete, errors occurred!
See also "C:/Users/Mark/esp/projects/esp-aws-iot/build/CMakeFiles/CMakeOutput.log".
idf.py build
Executing action: all (aliases: build)
CMakeLists.txt not found in project directory c:\users\mark\esp\projects\esp-aws-iot\build
Build complete (0 errors, 0 warnings): C:\Users\Mark\esp\projects\esp-aws-iot\build
What is the best way to get Eclipse working for this project??
Thank you,
Mark
The installation of ESP-IDF and Eclipse went pretty well after I ignored the "minimum version" requirements for Python and git and just installed the latest versions of those tools before installing ESP-IDF.
ESP-IDF Instructions:
https://docs.espressif.com/projects/esp ... t-started/
Eclipse Instructions:
https://github.com/espressif/idf-eclipse-plugin
Now it is possible to import an ESP-IDF example project, compile it in Eclipse, and resolve symbols just like a real IDE. Perfect.
But the example project that I want to use is not in the ESP-IDF examples. It is
https://github.com/espressif/esp-aws-iot
The difference seems to be that to manually build the ESP-IDF examples, you run idf.py build from the project directory. To build the esp-aws-iot examples, you have to run idf.py build from the subdirectories: examples/subscribe_publish or examples/thing_shadow.
In the Launch Configuration that I made when importing the project, I set the build directory to examples/subscribe_publish and the build command to idf.py build.
The build messages show that it is still attempting to build in the top project directory and getting confused with CMakeLists.txt.
Building manually in a CMD window would be tolerable but the project also does not resolve any of the ESP headers or functions which is the best part of Eclipse.
I realize that it would be possible to completely restructure the project to resemble the examples but that would impair the ability to get upstream changes via git.
Here is the command window output:
Building in: C:\Users\Mark\esp\projects\esp-aws-iot\build
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=C:\Users\Mark\Desktop\esp-idf\tools\cmake\toolchain-esp32.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DIDF_TARGET=esp32 C:\Users\Mark\esp\projects\esp-aws-iot
CMake Error at CMakeLists.txt:26 (register_component):
Unknown CMake command "register_component".
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.13)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring incomplete, errors occurred!
See also "C:/Users/Mark/esp/projects/esp-aws-iot/build/CMakeFiles/CMakeOutput.log".
idf.py build
Executing action: all (aliases: build)
CMakeLists.txt not found in project directory c:\users\mark\esp\projects\esp-aws-iot\build
Build complete (0 errors, 0 warnings): C:\Users\Mark\esp\projects\esp-aws-iot\build
What is the best way to get Eclipse working for this project??
Thank you,
Mark