include error by using an external project
Posted: Wed Oct 04, 2023 12:56 am
Hello together,
currently I'm trying to include the lwm2m-protocol to the esp32-wroom.
So I'm trying among others to include an external project / library in the CMakeLists.txt of my esp32-project.
But cmake can`t find the includes imy "main.c".
I get the error messages `fatal error: lwm2m/connect.h: No such file or directory`;
Or `fatal error: ../../network_common.h: No such file or directory`.
If I get the first error message, then cmake can't find the include from my "main.c".
If I get the second error message, then cmake can't find the include from lwm2m/connect.h.
The external project that I am currently trying to include is wakaamaNode.
Here you can see the link to the external project: https://github.com/smartheim/wakaamaNode.git
I'm working on Ubuntu with with the VSCode-IDE. But the build process i do with idf.py v4.4.6 in the terminal.
Does anyone has an idea how I could include the src.cmake file or the src-directory so that cmake finds the includes?
I would be so gratefull if someone could help me. I currently do not know what I am doing wrong.
In the following I have tried to give an insight into my current project.
CMakeLists.txt
main/CMakkeLists.txt
lwm2m-to-esp32-test02.c
many thanks
mmueller
currently I'm trying to include the lwm2m-protocol to the esp32-wroom.
So I'm trying among others to include an external project / library in the CMakeLists.txt of my esp32-project.
But cmake can`t find the includes imy "main.c".
I get the error messages `fatal error: lwm2m/connect.h: No such file or directory`;
Or `fatal error: ../../network_common.h: No such file or directory`.
If I get the first error message, then cmake can't find the include from my "main.c".
If I get the second error message, then cmake can't find the include from lwm2m/connect.h.
The external project that I am currently trying to include is wakaamaNode.
Here you can see the link to the external project: https://github.com/smartheim/wakaamaNode.git
I'm working on Ubuntu with with the VSCode-IDE. But the build process i do with idf.py v4.4.6 in the terminal.
Does anyone has an idea how I could include the src.cmake file or the src-directory so that cmake finds the includes?
I would be so gratefull if someone could help me. I currently do not know what I am doing wrong.
In the following I have tried to give an insight into my current project.
- /lwm2m-to-esp32-test02
- +---components
- | +...
- |
- +---main
- | +---lwm2m-to-esp32-test02.c
- | +---CMakeLists.txt
- |
- +---wakaamaNode
- | +---src
- | +---includes
- | | +---lwm2m
- | | | +--connect.h
- | | | + ...
- | | +---lwm2mObjects
- | | + ...
- | +---network
- | | + ...
- | +---...
- | +---src.cmake
- |
- +---partitions.csv
- +---sdkconfig
- +---CMakeLists.txt
- cmake_minimum_required(VERSION 3.16)
- include($ENV{IDF_PATH}/tools/cmake/project.cmake)
- include(${CMAKE_CURRENT_LIST_DIR}/wakaamaNode/src/src.cmake) #fatal error: lwm2m/connect.h: No such file or directory
- #include_directories(${CMAKE_CURRENT_LIST_DIR}/wakaamaNode/src/include/) # fatal error: ../../network_common.h: No such file or directory
- #include_directories(${CMAKE_CURRENT_LIST_DIR}/wakaamaNode/src/network/) # fatal error: ../../network_common.h: No such file or directory
- project(lwm2m-to-esp32-test02 VERSION 1.0.0)
- idf_component_register(SRCS "lwm2m-to-esp32-test02.c"
- INCLUDE_DIRS ".")
- #include <string.h>
- #include <stdlib.h>
- #include <stdint.h>
- #include <stdio.h>
- #include <errno.h>
- #include <time.h>
- #include "cblink.h"
- #include "lwm2m/connect.h" //???
- #include "lwm2m/network.h"
- //#include "connect.h"
- //#include "network.h"
- void app_main(void)
- {
- config_blink();
- while(1){
- blink_on();
- }
- }
mmueller