Support for OS X shared libraries installation.

cmake build turns out to use clang/LLVM compiler on OS X
and generated shared libraries turn out to have a different
extension from linux ones: lib*.dylib instead of lib*.so.