I might add that I tried to make CmakeLists.txt files in all the MDF components manually.
.../esp-mdf/components/mcommon/CMakeLists.txt example:
Code: Select all
set(COMPONENT_ADD_INCLUDEDIRS include)
set(COMPONENT_SRCS ./mdf_event_loop.c ./mdf_err_to_name.c ./mdf_info_store.c ./mdf_mem.c)
register_component()
And in the CMakeLists.txt in the project root
Code: Select all
# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
set(MDF_VER command bash -c "cd $ENV{MDF_PATH} && git describe --always --tags --dirty")
#CPPFLAGS := -D MDF_VER=\"$(MDF_VER)\"
set(EXTRA_COMPONENT_DIRS $ENV{MDF_PATH}/components $ENV{MDF_PATH}/components/third_party)
#set(EXTRA_COMPONENT_DIRS ${EXTRA_COMPONENT_DIRS} )
message(STATUS "EXTRA_COMPONENT_DIRS: ${EXTRA_COMPONENT_DIRS}")
set(CMAKE_SYSROOT $ENV{IDF_PATH}/../xtensa-esp32-elf/xtensa-esp32-elf)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
include_directories(
$ENV{IDF_PATH}/../xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0
$ENV{IDF_PATH}/../xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/xtensa-esp32-elf
$ENV{IDF_PATH}/../xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/backward
$ENV{IDF_PATH}/../xtensa-esp32-elf/lib/gcc/xtensa-esp32-elf/5.2.0/include
$ENV{IDF_PATH}/../xtensa-esp32-elf/lib/gcc/xtensa-esp32-elf/5.2.0/include-fixed
$ENV{IDF_PATH}/../xtensa-esp32-elf/xtensa-esp32-elf/include
)
project(cpp-mesh)
idf.py build fails with:
/home/jri/work/doms-wireless/projects/cpp-mesh/components/cpp-classes/Mesh.cpp:10:19: fatal error: mwifi.h: No such file or directory