in your project A,B and C are sub project,
so a possible solution is on every sub project have a structure like that:
project(
'A',
'cpp',
version : '1.0.0',
default_options : ['warning_level=3']
)
project_description = ' ....'
sourceRoot = meson.source_root()
project_headers = [ # add your project headers ]
public_headers = [# add public header ]
build_args = [#add build args.... ]
# ======
# Target
# ======
#shared or static lib or executable....
project_target = shared_library( ...... )
# =======
# Project
# =======
# Make this library usable as a Meson subproject.
project_dep = declare_dependency(
include_directories: public_headers
)
set_variable(meson.project_name() + '_dep', project_dep)
# Make this library usable from the system's
# package manager.
#install_headers(project_headers, subdir : meson.project_name())
pkg_mod = import('pkgconfig')
pkg_mod.generate(
name : meson.project_name(),
filebase : meson.project_name(),
description : project_description,
subdirs : meson.project_name(),
)
an the same for B,C sub project,
than in the main meson must specify sub projects folders and add the dependency
...
project(
'MyProjj',
'cpp',
version : '1.1.0',
default_options : ['buildtype=plain','warning_level=3'],
subproject_dir : 'Source',
meson_version: '>= <the version you want to use>'
)
.......
dependency('A', fallback : ['<A path>', 'A_dep']),
dependency('B', fallback : ['<B path>', 'B_dep']),
dependency('C', fallback : ['<C path>', 'C_dep']),
so referring to your example:
Project/
meson.build
BuildDir/
Source/
A/
...
"A path" is A,
and the first parameter of dependency(...) is the names of the dependency too look up