CMAKE_OSX_DEPLOYMENT_TARGET has no effect when not building for macOS.
MACOSX_RPATH must be set explicitly for OpenAL to be found. It is default using newer cmake, but OpenAL is using cmake 2.6.
Allows future macOS configuration in each individual build script to not all be
duplicated. Also deduplicates current Windows arg checking and config setting.
foo=dirname "$0" only works if the script is called with an absolute path and
that path contains no spaces. Add quotes everywhere to contain spaces in
directory names or file names, and add realpath to get the absolute path
regardless of call path.
Not necessarily needed, but like in e405868037
it can avoid some annoying issues when e.g. that script was called with a
relative path in CI.