Opam external dep location

Is there a way to ask opam to use external dependencies from a non-system location? The context is that I’m on a Mac and using MacPorts, so all my dependencies go into /opt/local, which I believe is not a path opam checks by default.

For example, if I installed hdf5 library from MacPorts, the header is /opt/local/include/hdf5.h. However, when I try opam install hdf5 to get the ocaml wrapper, I get the following:

# In file included from hid_stubs.c:4:
# ./hdf5_caml.h:2:10: fatal error: 'hdf5.h' file not found
# #include "hdf5.h"

In other words I believe opam is looking for hdf5.h as though it were a system library (so something like SDK path /Applications/Xcode.app/...).

What’s the right way to make this work? Can I register external dependencies elsewhere? Or do I need to find a way to install into default locations?