5

I am trying to build custom gst-plugin which has third party library dependency.

With cc.find_library and dirs option (takes absolute path) I am able to build the setup.

But I want to include the relative paths, so that when others uses my package they don't have to change anything, just run the meson build. Is there any way to do the same: to add/include relative to search library in directories?

abbath
  • 2,444
  • 4
  • 28
  • 40
saleem
  • 53
  • 5

1 Answers1

15

find_library() does indeed require an absolute path. There is no way around that. You can use internal meson functionality to still succeed though:

cc.find_library('foo', dirs : meson.current_source_dir() + '/lib')

Florian Zwoch
  • 6,764
  • 2
  • 12
  • 21
  • I think that a better solution would be to put a dependency (install it) for example in `/opt//` directory, and then use `cc.find_library('foo', dirs: '/opt//')`. It wont interfere with the system in any way and will have its own place. – Kostiantyn Ponomarenko May 03 '20 at 21:20
  • 1
    @KostiantynPonomarenko I don't see how creating untracked files over your operating system can be better. – Hi-Angel Sep 09 '21 at 09:35