fix CMakeLists.txt on Mac/Linux when using BUILD_SHARED_LIBS
Merge pull request #249 from erwincoumans/master

fix CMakeLists.txt on Mac/Linux when using BUILD_SHARED_LIBS