Build system nested folders

vanBassum
Posts: 68
Joined: Sun Jan 17, 2021 11:59 am

Build system nested folders

Postby vanBassum » Sun Jan 17, 2021 12:13 pm

Hello,

I have been trying to wrap my head around the build system. I have the following configuration in mind:

Code: Select all



- components
	- internet						//resources downloaded from internet. (git submodule)
		- esp-32-owb				//https://github.com/DavidAntliff/esp32-owb

	- onewire
		- onewire.h 				//includes onewirebus.h and all onewiredevices. So in the main i only have to include this file to get access to all onewire devices.

		- onewirebus
			- onewirebus.h			//represents a onewire bus. This is a CPP wrapper around esp-32-owb. Has a function to search for devices, returns list of onewiredevice
			- onewirebus.cpp		

		- devices
			- onewiredevice.h		//a onewire device of unknown type. (uses onewirebus for comminucation.)
			- onewiredevice.cpp
			- ds18B20.h				//inherits onewiredevice, adds functions like ReadTemperature(). Uses onewirebus for comminucation.
			- ds18B20.h
			
I quite lost what the CMakeList.txt should contain and where I need to add "component.mk". In onewirebus e.g. I need to add REQUIRES to the esp-32-owb and onewiredevice. I have no idea how to do this. How is the name of a component determained? The name of the folder???

vanBassum
Posts: 68
Joined: Sun Jan 17, 2021 11:59 am

Re: Build system nested folders

Postby vanBassum » Thu Jan 28, 2021 9:40 am

Let me rephrase the question,
Say I have the following directory structure:

Code: Select all

- components
	- onewire
		- esp-32-owb
			- makelist.txt
			- *** some files ***
		- MyOneWire.h
		- MyOneWire.cpp
		- makelist.txt
The folder esp-32-owb contains a library from the internet, it has its own makelist.txt, and it works as is. Now I have made a CPP wrapper that uses this library. This wrapper can be found inside the onewire directory. The wrapper has its own makelist.txt, and I would like to add the esp-32-owb as an 'REQUIRES' to my wrapper.

So in general my question is this:
- How do components work with nested folders?
- How is the name of the component determined?

Who is online

Users browsing this forum: No registered users and 129 guests