espressif / esp-mdf

Espressif Mesh Development Framework, limited maintain, recommend to use https://github.com/espressif/esp-mesh-lite
Other
766 stars 249 forks source link

Cannot compile code which uses both esp-idf and esp-mdf apis #296

Open karunt opened 2 years ago

karunt commented 2 years ago

Environment

Problem Description

Trying to use a esp-mdf example with esp-idf example. So my overall code relies on both esp-mdf and esp-idf components. However, when compiling my code, CMake throws the following error repeatedly and doesn't do anything else:

Component directory C:/Users/[Username]/ESP/esp-mdf/components/third_party does not contain a CMakeLists.txt file. No component will be added ccache will be used for faster recompilation

Here are what my top level and project level CMakeLists.txt files look like:

Top level CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)
list(APPEND EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/components" "$ENV{MDF_PATH}/components")
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
include($ENV{MDF_PATH}/project.cmake)
project(ble_and_wifimesh)

Project level CMakeLists.txt

idf_component_register(SRCS "main.c" "http.c" "spiffs.c" "wifi_mesh.c" "wifi_provision.c"
                    INCLUDE_DIRS "include"
                    PRIV_REQUIRES esp_http_client mwifi nvs_flash spiffs spi_flash tcp_transport wifi_provisioning)

My project directory (main) includes the following source files: include/main.h CMakeLists.txt component.mk http.c kconfig.projbuild main.c spiffs.c wifi_mesh.c wifi_provision.c wifi.c

Expected Behavior

I wouldn't have expected this to be an issue since not every directory in esp-mdf/components needs to have a cmakelists.txt file.

Actual Behavior

Steps to repropduce

Code to reproduce this issue

Debug Logs

Other items if possible