Cmake fixes

A few small fixes, in general and for OSX. The "Apple only" one is for compliance with CMake 3's new policies with respect to handling RPATH and INSTALL_NAME (meaning: they need to be set).