fixed build on OSX with mysterious CMake option #983
Merge branch 'merge-libs' into merge-libs-master