Include aws-iot-device-sdk-cpp-v2 in esp-idf CMake
Posted: Wed Jun 10, 2020 12:07 am
I attempted to include aws-iot-device-sdk-cpp-v2 into my esp-idf CMake project but encountered the following errors, how do I resolve?
Error as follows:
These are my steps:
1. Clone the esp-idf-template
2. Clone the aws-iot-device-sdk-cpp-v2 and update to pull in recursively
3. Update the CMakeLists.txt in main/ folder to include aws-iot-device-sdk-cpp-v2
3. Attempt to build
Error as follows:
Code: Select all
esp-idf-template % idf.py build
Executing action: all (aliases: build)
Running ninja in directory ~/Documents/github/esp-idf-template/build
Executing "ninja all"...
[0/1] Re-running CMake...
-- Building ESP-IDF components for target esp32
CMake Error at ~/Documents/github/esp-idf/tools/cmake/component.cmake:221 (message):
CMake Error at
~/Documents/github/esp-idf-template/components/aws-iot-device-sdk-cpp-v2/CMakeLists.txt:2
(project):
project command is not scriptable
Call Stack (most recent call first):
~/Documents/github/esp-idf/tools/cmake/scripts/component_get_requirements.cmake:60 (include)
~/Documents/github/esp-idf/tools/cmake/scripts/component_get_requirements.cmake:76 (__component_get_requirements)
Call Stack (most recent call first):
~/Documents/github/esp-idf/tools/cmake/build.cmake:405 (__component_get_requirements)
~/Documents/github/esp-idf/tools/cmake/project.cmake:395 (idf_build_process)
CMakeLists.txt:6 (project)
-- Configuring incomplete, errors occurred!
See also "~/Documents/github/esp-idf-template/build/CMakeFiles/CMakeOutput.log".
FAILED: build.ninja
~/.espressif/tools/cmake/3.16.4/CMake.app/Contents/bin/cmake -S~/Documents/github/esp-idf-template -B~/Documents/github/esp-idf-template/build
ninja: error: rebuilding 'build.ninja': subcommand failed
ninja failed with exit code 1
1. Clone the esp-idf-template
Code: Select all
~/Documents/github % git clone https://github.com/espressif/esp-idf-template.git
Code: Select all
~/Documents/github % cd esp-idf-template
~/Documents/github/esp-idf-template % mkdir components && cd components
~/Documents/github/esp-idf-template/components % git submodule add https://github.com/aws/aws-iot-device-sdk-cpp-v2.git && git submodule update --init --recursive
Code: Select all
set(COMPONENT_REQUIRES aws-iot-device-sdk-cpp-v2)
Code: Select all
~/Documents/github/esp-idf-template % idf.py build