2025-03-10 14:08:51 +02:00
|
|
|
project('netconf')
|
|
|
|
cpp = meson.get_compiler('cpp')
|
|
|
|
SYSTEM = build_machine.system()
|
|
|
|
|
|
|
|
netconf_deps = {}
|
|
|
|
|
|
|
|
foreach dep : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp']
|
|
|
|
netconf_deps = netconf_deps + {dep: dependency(dep, required: false)}
|
|
|
|
if netconf_deps[dep].found()
|
|
|
|
continue
|
|
|
|
endif
|
|
|
|
|
2025-03-26 15:17:59 +02:00
|
|
|
# Try adding lib to it. yang and yang-cpp define the wrong pkg-config.
|
2025-03-10 14:08:51 +02:00
|
|
|
netconf_deps = netconf_deps + {
|
|
|
|
dep: dependency('lib' + dep, required: false),
|
|
|
|
}
|
|
|
|
if netconf_deps[dep].found()
|
|
|
|
continue
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
all_deps_found = true
|
|
|
|
foreach dep : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp']
|
|
|
|
if not netconf_deps[dep].found()
|
|
|
|
all_deps_found = false
|
|
|
|
break
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
if all_deps_found
|
2025-03-13 00:03:28 +01:00
|
|
|
variables = {}
|
2025-03-26 15:17:59 +02:00
|
|
|
foreach i : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp']
|
|
|
|
if netconf_deps[i].found()
|
|
|
|
libdir = netconf_deps[i].get_variable('libdir')
|
|
|
|
prefix = netconf_deps[i].get_variable('prefix')
|
|
|
|
version = netconf_deps[i].version()
|
|
|
|
if version == 'unknown'
|
|
|
|
version = 'unknown version'
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
prefix = 'unknown'
|
|
|
|
version = 'unknown version'
|
2025-03-18 17:04:34 +01:00
|
|
|
endif
|
2025-03-26 15:17:59 +02:00
|
|
|
variables += {f'@i@-libdir': libdir}
|
|
|
|
variables += {f'@i@-prefix': prefix}
|
|
|
|
variables += {f'@i@-version': version}
|
|
|
|
endforeach
|
2025-03-10 14:08:51 +02:00
|
|
|
netconf = declare_dependency(
|
|
|
|
dependencies: [
|
|
|
|
netconf_deps['yang'],
|
|
|
|
netconf_deps['yang-cpp'],
|
|
|
|
netconf_deps['sysrepo'],
|
|
|
|
netconf_deps['sysrepo-cpp'],
|
|
|
|
],
|
2025-03-13 00:03:28 +01:00
|
|
|
variables: variables,
|
2025-03-10 14:08:51 +02:00
|
|
|
)
|
|
|
|
else
|
2025-03-13 00:03:28 +01:00
|
|
|
# Can't use a disabler here?
|
2025-03-15 00:30:58 +01:00
|
|
|
netconf = dependency('')
|
2025-03-10 14:08:51 +02:00
|
|
|
endif
|