Allow variables from indirect dependencies to bubble up

The problem with using a 'function' instead of a 'macro' was that variables from dependencies of the dependencies didn't get copied up to the main routine, and while that worked for include directories etc. which got aggregated, it caused problems for the HAVE_ variables in config.h

Note to maintainer: I believe this patch will conflict with OPM/opm-core#199; drop me a PM after 199 is committed and I'll rebase this one to something that can commit without conflicts.