diff --git a/meson.build b/meson.build index aada9978..f1ac2a42 100644 --- a/meson.build +++ b/meson.build @@ -15,14 +15,25 @@ project_description = 'Implementation Guardian of Analysis Algorithms' # resolve dependencies fmt_dep = dependency('fmt', version: '>=9.1.0', method: 'pkg-config') hipo_dep = dependency('hipo4', version: '>=4.0.1', method: 'pkg-config') +full_dep_list = [ + fmt_dep, + hipo_dep, +] + +# dependency libdirs +dep_lib_paths = [] +foreach dep : full_dep_list + dep_lib_paths += dep.get_variable(pkgconfig: 'libdir') +endforeach # general project vars project_lib_rpath = '$ORIGIN' project_inc = include_directories('src') project_libs = [] -project_deps = declare_dependency(dependencies: [ fmt_dep, hipo_dep ]) +project_deps = declare_dependency(dependencies: full_dep_list) project_pkg_vars = [ - 'dep_pkgconfigdirs=' + ':'.join(get_option('pkg_config_path')) + 'dep_pkgconfigdirs=' + ':'.join(get_option('pkg_config_path')), + 'dep_libdirs=' + ':'.join(dep_lib_paths), ] # build and install shared libraries @@ -40,7 +51,7 @@ pkg.generate( name: meson.project_name(), description: project_description, libraries: project_libs, - requires: [ fmt_dep, hipo_dep ], + requires: full_dep_list, variables: project_pkg_vars, ) diff --git a/meson/this_iguana.sh.in b/meson/this_iguana.sh.in index 0b3b0644..ce491f7f 100644 --- a/meson/this_iguana.sh.in +++ b/meson/this_iguana.sh.in @@ -14,10 +14,19 @@ dep_pkgconfigdirs=$(pkg-config --variable dep_pkgconfigdirs iguana) iguana_pythonpath=$(pkg-config --variable pythonpath iguana) [ -n "${iguana_pythonpath-}" ] && export PYTHONPATH=$iguana_pythonpath${PYTHONPATH:+:${PYTHONPATH}} +# TEST: hack ld path for mac +for var in libdir dep_libdirs; do + dir=$(pkg-config --variable $var iguana) + # FIXME: support LD_LIBRARY_PATH too + # FIXME: uniqueness of path entries + [ -n "${dir-}" ] && export DYLD_LIBRARY_PATH=$dir${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}} +done + echo """ Iguana Environment Variables ---------------------------- PKG_CONFIG_PATH = ${PKG_CONFIG_PATH-} PYTHONPATH = ${PYTHONPATH-} +DYLD_LIBRARY_PATH = ${DYLD_LIBRARY_PATH-} ---------------------------- """