Hi there,
I have 2 IDF projects, let's call them "main" and "extra", and I'd like to include components from "extra" project into "main". How do I do that?
So far I tried setting EXTRA_COMPONENT_DIRS, and SRC_DIRS in the main project CMakeLists file, but still build process cannot find them.
Any help would be appreciated.
How to include components from another project?
Re: How to include components from another project?
You need to set it in the project's top-level CMakeLists.txt file the as opposed to its own "main" component file. Then do an idf reconfigure.
If you're not on Windows, you can also just create a symlink in the project's "components" directory that points to the other component's directory. This is how I do it when I'm working on both the main project and components at the same time because it's easier to move between the two from an IDE. In fact, all of my components live outside the main projects and the projects just symlink to them. There's no conflict because all project build artifacts go into the project's build directory.
Code: Select all
cmake_minimum_required(VERSION 3.5)
set(EXTRA_COMPONENT_DIRS /path/to/somecomponent)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(MyProject)
Who is online
Users browsing this forum: No registered users and 105 guests