Cmakelists.txt suggestions for multiple components
See original GitHub issueI was able to get it included by adding this to my CMakeLists at the top level:
set(EXTRA_COMPONENT_DIRS "components/cpp_utils")
and then in the cpp_utils folder, I added this:
# Edit following two lines to set component requirements (see docs)
set(COMPONENT_REQUIRES
"console"
"fatfs"
"json"
"mdns"
"nvs_flash"
)
set(COMPONENT_PRIV_REQUIRES )
file(GLOB COMPONENT_SRCS
LIST_DIRECTORIES false
"*.h"
"*.cpp"
"*.c"
"*.S"
)
set(COMPONENT_ADD_INCLUDEDIRS ".")
register_component()
My question is, if I have a 2nd Library next to cpp_utils in the components folder, how does it know about cpp_utils. I tried adding it in the COMPONENT_REQUIRES , but that doesn’t seem to work…
thoughts?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:18 (6 by maintainers)
Top Results From Across the Web
basic project setup with multiple components - cmake
My project does not have a top-level CMakeLists file, it consists of multiple components. Some of them can be built independently, while some ......
Read more >CMakeLists.txt | CLion Documentation - JetBrains
txt files to describe the build, contents, and target rules for a subdirectory. Type of a target added by a subdirectory CMakeLists. txt...
Read more >[cmake-developers] [CMake] Support for multiple components ...
Here's my test case >> ===== >> file(WRITE file.txt.in "hi") ... Its still multiple files with their component specific names.
Read more >How to setup CMAKE to compile with more than one ...
The main idea of components is that you declare include directories at component level and then specify dependencies between components. If you ...
Read more >Build System - ESP32 - — ESP-IDF Programming Guide latest ...
See writing pure CMake components for some information about writing more ... The IDE will want to know the path to the project's...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @wegunterjr ! Thanks for the report. First thing, you shouldn’t override
EXTRA_COMPONENT_DIRS
variable as PlatformIO also relies on it so you should append new components to this variable instead. I use the following configuration:Top level
CMakeLists.txt
:CMakeLists.txt
forhello
component:CMakeLists.txt
forworld
component that depends onhello
:should be
and must be placed above the line