ShellAddicted / BNO055ESP32

C++ Interface for the Bosch-Sensortec's BNO055 compatible with Espressif's ESP32 SoC running esp-idf.
MIT License
24 stars 9 forks source link

Unknown CMake command "register_component". #5

Closed marcel-bluestone closed 4 years ago

marcel-bluestone commented 4 years ago

Hello,

I can't compile this example. When running idf.py menuconfig, I end up with the following errors:

` idf.py menuconfig Checking Python dependencies... Python requirements from /Users/marcel/esp/esp-idf/requirements.txt are satisfied. Executing action: menuconfig Running cmake in directory /Users/marcel/esp/components/BNO055ESP32/build Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 --warn-uninitialized -DCCACHE_ENABLE=0 /Users/marcel/esp/components/BNO055ESP32"... Warn about uninitialized values. -- The C compiler identification is AppleClang 11.0.3.11030032 -- The CXX compiler identification is AppleClang 11.0.3.11030032 -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Error at CMakeLists.txt:4 (register_component): Unknown CMake command "register_component".

-- Configuring incomplete, errors occurred! See also "/Users/marcel/esp/components/BNO055ESP32/build/CMakeFiles/CMakeOutput.log". cmake failed with exit code 1 `

ShellAddicted commented 4 years ago

Hi, your problem seems related to CMake, not to this specific library. Please make sure you followed the correct installation steps of the Espressif IDF.

I usually suggest to use the docker environment to compile the code, more details here: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-docker-image.html

I've just tested against the latest version (master) of idf, and it compiles successfully.

marcel-bluestone commented 4 years ago

I just tried it on a fresh xubuntu 18.04 install. I followed the esp-idf install path for linux, created a new project folder under Esp/project. cd project mkdir components/ cd components/ git clone https://github.com/ShellAddicted/BNO055ESP32.git

cd into BNO055ESP32 Ida.py menuconfig -> ... CMake Error at CMakeLists.txt:3 (register_component): Unknown CMake command "register_component".

Is there anything I am missing? I can successfully build the hello_world example from Espressif, so the build environment seems to be ok.

ShellAddicted commented 4 years ago

cd into BNO055ESP32

that's the problem, make sure you are in your project root (aka the folder that contains components/ and main/ folders) when you run idf.py