My project (in C) has a third party dependency at build time. But the third party library is, by default, installed to /opt/
instead of /lib
, and I can
Refer to meson
object here : current_source_dir() method returns a string to the current source directory.
Use it for the case libhello.so
and libhello.h
are located in
directory
/main.c
/meson.build
/hello/libhello.so
/hello/libhello.h
/hello/meson.build
In
:
lib_hello = cc.find_library('hello', dirs : meson.current_source_dir())
In
:
project('myproj', 'c')
subdir('hello')
inc_hello = include_directories('./')
exec = executable('app',
'main.c',
dependencies : [lib_hello],
include_directories : inc_hello)