Best way to configure a library only project

william.ferguson.au
Posts: 107
Joined: Wed Jan 02, 2019 8:55 am

Best way to configure a library only project

Postby william.ferguson.au » Mon May 13, 2019 10:07 am

I have a ESP32 library component that I want to use in multiple ESP32 projects.
I plan to include it as a git submodule in the components folder of the client projects and have crafted the library's CMakeLists.txt to reflect that it is a component of another project. This works well when compiling the client projects.

Eg

Code: Select all

SET (COMPONENT_REQUIRES
        arduino-esp32
        lwip
)

SET (COMPONENT_ADD_INCLUDEDIRS includes)
SET (COMPONENT_SRCS
        "src/foo.c"
        "src/bar.c"
)

register_component()
But is there a way for me to also be able to compile the library project standalone?
If so how?
Do I have a second CMakeLists.txt for the library? If so, what does it look like (I can't get anything to compile)?
And how do I invoke a different CMakeLists.txt?

Or is there another way that I should be thinking about this?

Who is online

Users browsing this forum: No registered users and 127 guests